home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / python-support / python-libxml2 / python2.5 / libxml2.py next >
Encoding:
Python Source  |  2009-08-11  |  327.9 KB  |  9,080 lines

  1. import libxml2mod
  2. import types
  3. import sys
  4.  
  5. # The root of all libxml2 errors.
  6. class libxmlError(Exception): pass
  7.  
  8. #
  9. # id() is sometimes negative ...
  10. #
  11. def pos_id(o):
  12.     i = id(o)
  13.     if (i < 0):
  14.         return (sys.maxint - i)
  15.     return i
  16.  
  17. #
  18. # Errors raised by the wrappers when some tree handling failed.
  19. #
  20. class treeError(libxmlError):
  21.     def __init__(self, msg):
  22.         self.msg = msg
  23.     def __str__(self):
  24.         return self.msg
  25.  
  26. class parserError(libxmlError):
  27.     def __init__(self, msg):
  28.         self.msg = msg
  29.     def __str__(self):
  30.         return self.msg
  31.  
  32. class uriError(libxmlError):
  33.     def __init__(self, msg):
  34.         self.msg = msg
  35.     def __str__(self):
  36.         return self.msg
  37.  
  38. class xpathError(libxmlError):
  39.     def __init__(self, msg):
  40.         self.msg = msg
  41.     def __str__(self):
  42.         return self.msg
  43.  
  44. class ioWrapper:
  45.     def __init__(self, _obj):
  46.         self.__io = _obj
  47.         self._o = None
  48.  
  49.     def io_close(self):
  50.         if self.__io == None:
  51.             return(-1)
  52.         self.__io.close()
  53.         self.__io = None
  54.         return(0)
  55.  
  56.     def io_flush(self):
  57.         if self.__io == None:
  58.             return(-1)
  59.         self.__io.flush()
  60.         return(0)
  61.  
  62.     def io_read(self, len = -1):
  63.         if self.__io == None:
  64.             return(-1)
  65.         if len < 0:
  66.             return(self.__io.read())
  67.         return(self.__io.read(len))
  68.  
  69.     def io_write(self, str, len = -1):
  70.         if self.__io == None:
  71.             return(-1)
  72.         if len < 0:
  73.             return(self.__io.write(str))
  74.         return(self.__io.write(str, len))
  75.  
  76. class ioReadWrapper(ioWrapper):
  77.     def __init__(self, _obj, enc = ""):
  78.         ioWrapper.__init__(self, _obj)
  79.         self._o = libxml2mod.xmlCreateInputBuffer(self, enc)
  80.  
  81.     def __del__(self):
  82.         print "__del__"
  83.         self.io_close()
  84.         if self._o != None:
  85.             libxml2mod.xmlFreeParserInputBuffer(self._o)
  86.         self._o = None
  87.  
  88.     def close(self):
  89.         self.io_close()
  90.         if self._o != None:
  91.             libxml2mod.xmlFreeParserInputBuffer(self._o)
  92.         self._o = None
  93.  
  94. class ioWriteWrapper(ioWrapper):
  95.     def __init__(self, _obj, enc = ""):
  96. #        print "ioWriteWrapper.__init__", _obj
  97.         if type(_obj) == type(''):
  98.             print "write io from a string"
  99.             self.o = None
  100.         elif type(_obj) == types.InstanceType:
  101.             print "write io from instance of %s" % (_obj.__class__)
  102.             ioWrapper.__init__(self, _obj)
  103.             self._o = libxml2mod.xmlCreateOutputBuffer(self, enc)
  104.         else:
  105.             file = libxml2mod.outputBufferGetPythonFile(_obj)
  106.             if file != None:
  107.                 ioWrapper.__init__(self, file)
  108.             else:
  109.                 ioWrapper.__init__(self, _obj)
  110.             self._o = _obj
  111.  
  112.     def __del__(self):
  113. #        print "__del__"
  114.         self.io_close()
  115.         if self._o != None:
  116.             libxml2mod.xmlOutputBufferClose(self._o)
  117.         self._o = None
  118.  
  119.     def flush(self):
  120.         self.io_flush()
  121.         if self._o != None:
  122.             libxml2mod.xmlOutputBufferClose(self._o)
  123.         self._o = None
  124.  
  125.     def close(self):
  126.         self.io_flush()
  127.         if self._o != None:
  128.             libxml2mod.xmlOutputBufferClose(self._o)
  129.         self._o = None
  130.  
  131. #
  132. # Example of a class to handle SAX events
  133. #
  134. class SAXCallback:
  135.     """Base class for SAX handlers"""
  136.     def startDocument(self):
  137.         """called at the start of the document"""
  138.         pass
  139.  
  140.     def endDocument(self):
  141.         """called at the end of the document"""
  142.         pass
  143.  
  144.     def startElement(self, tag, attrs):
  145.         """called at the start of every element, tag is the name of
  146.            the element, attrs is a dictionary of the element's attributes"""
  147.         pass
  148.  
  149.     def endElement(self, tag):
  150.         """called at the start of every element, tag is the name of
  151.            the element"""
  152.         pass
  153.  
  154.     def characters(self, data):
  155.         """called when character data have been read, data is the string
  156.            containing the data, multiple consecutive characters() callback
  157.            are possible."""
  158.         pass
  159.  
  160.     def cdataBlock(self, data):
  161.         """called when CDATA section have been read, data is the string
  162.            containing the data, multiple consecutive cdataBlock() callback
  163.            are possible."""
  164.         pass
  165.  
  166.     def reference(self, name):
  167.         """called when an entity reference has been found"""
  168.         pass
  169.  
  170.     def ignorableWhitespace(self, data):
  171.         """called when potentially ignorable white spaces have been found"""
  172.         pass
  173.  
  174.     def processingInstruction(self, target, data):
  175.         """called when a PI has been found, target contains the PI name and
  176.            data is the associated data in the PI"""
  177.         pass
  178.  
  179.     def comment(self, content):
  180.         """called when a comment has been found, content contains the comment"""
  181.         pass
  182.  
  183.     def externalSubset(self, name, externalID, systemID):
  184.         """called when a DOCTYPE declaration has been found, name is the
  185.            DTD name and externalID, systemID are the DTD public and system
  186.            identifier for that DTd if available"""
  187.         pass
  188.  
  189.     def internalSubset(self, name, externalID, systemID):
  190.         """called when a DOCTYPE declaration has been found, name is the
  191.            DTD name and externalID, systemID are the DTD public and system
  192.            identifier for that DTD if available"""
  193.         pass
  194.  
  195.     def entityDecl(self, name, type, externalID, systemID, content):
  196.         """called when an ENTITY declaration has been found, name is the
  197.            entity name and externalID, systemID are the entity public and
  198.            system identifier for that entity if available, type indicates
  199.            the entity type, and content reports it's string content"""
  200.         pass
  201.  
  202.     def notationDecl(self, name, externalID, systemID):
  203.         """called when an NOTATION declaration has been found, name is the
  204.            notation name and externalID, systemID are the notation public and
  205.            system identifier for that notation if available"""
  206.         pass
  207.  
  208.     def attributeDecl(self, elem, name, type, defi, defaultValue, nameList):
  209.         """called when an ATTRIBUTE definition has been found"""
  210.         pass
  211.  
  212.     def elementDecl(self, name, type, content):
  213.         """called when an ELEMENT definition has been found"""
  214.         pass
  215.  
  216.     def entityDecl(self, name, publicId, systemID, notationName):
  217.         """called when an unparsed ENTITY declaration has been found,
  218.            name is the entity name and publicId,, systemID are the entity
  219.            public and system identifier for that entity if available,
  220.            and notationName indicate the associated NOTATION"""
  221.         pass
  222.  
  223.     def warning(self, msg):
  224.         #print msg
  225.         pass
  226.  
  227.     def error(self, msg):
  228.         raise parserError(msg)
  229.  
  230.     def fatalError(self, msg):
  231.         raise parserError(msg)
  232.  
  233. #
  234. # This class is the ancestor of all the Node classes. It provides
  235. # the basic functionalities shared by all nodes (and handle
  236. # gracefylly the exception), like name, navigation in the tree,
  237. # doc reference, content access and serializing to a string or URI
  238. #
  239. class xmlCore:
  240.     def __init__(self, _obj=None):
  241.         if _obj != None: 
  242.             self._o = _obj;
  243.             return
  244.         self._o = None
  245.  
  246.     def __eq__(self, other):
  247.         if other == None:
  248.             return False
  249.         ret = libxml2mod.compareNodesEqual(self._o, other._o)
  250.         if ret == None:
  251.             return False
  252.         return ret == True
  253.     def __ne__(self, other):
  254.         if other == None:
  255.             return True
  256.         ret = libxml2mod.compareNodesEqual(self._o, other._o)
  257.         return not ret
  258.     def __hash__(self):
  259.         ret = libxml2mod.nodeHash(self._o)
  260.         return ret
  261.  
  262.     def __str__(self):
  263.         return self.serialize()
  264.     def get_parent(self):
  265.         ret = libxml2mod.parent(self._o)
  266.         if ret == None:
  267.             return None
  268.         return xmlNode(_obj=ret)
  269.     def get_children(self):
  270.         ret = libxml2mod.children(self._o)
  271.         if ret == None:
  272.             return None
  273.         return xmlNode(_obj=ret)
  274.     def get_last(self):
  275.         ret = libxml2mod.last(self._o)
  276.         if ret == None:
  277.             return None
  278.         return xmlNode(_obj=ret)
  279.     def get_next(self):
  280.         ret = libxml2mod.next(self._o)
  281.         if ret == None:
  282.             return None
  283.         return xmlNode(_obj=ret)
  284.     def get_properties(self):
  285.         ret = libxml2mod.properties(self._o)
  286.         if ret == None:
  287.             return None
  288.         return xmlAttr(_obj=ret)
  289.     def get_prev(self):
  290.         ret = libxml2mod.prev(self._o)
  291.         if ret == None:
  292.             return None
  293.         return xmlNode(_obj=ret)
  294.     def get_content(self):
  295.         return libxml2mod.xmlNodeGetContent(self._o)
  296.     getContent = get_content  # why is this duplicate naming needed ?
  297.     def get_name(self):
  298.         return libxml2mod.name(self._o)
  299.     def get_type(self):
  300.         return libxml2mod.type(self._o)
  301.     def get_doc(self):
  302.         ret = libxml2mod.doc(self._o)
  303.         if ret == None:
  304.             if self.type in ["document_xml", "document_html"]:
  305.                 return xmlDoc(_obj=self._o)
  306.             else:
  307.                 return None
  308.         return xmlDoc(_obj=ret)
  309.     #
  310.     # Those are common attributes to nearly all type of nodes
  311.     # defined as python2 properties
  312.     # 
  313.     import sys
  314.     if float(sys.version[0:3]) < 2.2:
  315.         def __getattr__(self, attr):
  316.             if attr == "parent":
  317.                 ret = libxml2mod.parent(self._o)
  318.                 if ret == None:
  319.                     return None
  320.                 return xmlNode(_obj=ret)
  321.             elif attr == "properties":
  322.                 ret = libxml2mod.properties(self._o)
  323.                 if ret == None:
  324.                     return None
  325.                 return xmlAttr(_obj=ret)
  326.             elif attr == "children":
  327.                 ret = libxml2mod.children(self._o)
  328.                 if ret == None:
  329.                     return None
  330.                 return xmlNode(_obj=ret)
  331.             elif attr == "last":
  332.                 ret = libxml2mod.last(self._o)
  333.                 if ret == None:
  334.                     return None
  335.                 return xmlNode(_obj=ret)
  336.             elif attr == "next":
  337.                 ret = libxml2mod.next(self._o)
  338.                 if ret == None:
  339.                     return None
  340.                 return xmlNode(_obj=ret)
  341.             elif attr == "prev":
  342.                 ret = libxml2mod.prev(self._o)
  343.                 if ret == None:
  344.                     return None
  345.                 return xmlNode(_obj=ret)
  346.             elif attr == "content":
  347.                 return libxml2mod.xmlNodeGetContent(self._o)
  348.             elif attr == "name":
  349.                 return libxml2mod.name(self._o)
  350.             elif attr == "type":
  351.                 return libxml2mod.type(self._o)
  352.             elif attr == "doc":
  353.                 ret = libxml2mod.doc(self._o)
  354.                 if ret == None:
  355.                     if self.type == "document_xml" or self.type == "document_html":
  356.                         return xmlDoc(_obj=self._o)
  357.                     else:
  358.                         return None
  359.                 return xmlDoc(_obj=ret)
  360.             raise AttributeError,attr
  361.     else:
  362.         parent = property(get_parent, None, None, "Parent node")
  363.         children = property(get_children, None, None, "First child node")
  364.         last = property(get_last, None, None, "Last sibling node")
  365.         next = property(get_next, None, None, "Next sibling node")
  366.         prev = property(get_prev, None, None, "Previous sibling node")
  367.         properties = property(get_properties, None, None, "List of properies")
  368.         content = property(get_content, None, None, "Content of this node")
  369.         name = property(get_name, None, None, "Node name")
  370.         type = property(get_type, None, None, "Node type")
  371.         doc = property(get_doc, None, None, "The document this node belongs to")
  372.  
  373.     #
  374.     # Serialization routines, the optional arguments have the following
  375.     # meaning:
  376.     #     encoding: string to ask saving in a specific encoding
  377.     #     indent: if 1 the serializer is asked to indent the output
  378.     #
  379.     def serialize(self, encoding = None, format = 0):
  380.         return libxml2mod.serializeNode(self._o, encoding, format)
  381.     def saveTo(self, file, encoding = None, format = 0):
  382.         return libxml2mod.saveNodeTo(self._o, file, encoding, format)
  383.             
  384.     #
  385.     # Canonicalization routines:
  386.     #
  387.     #   nodes: the node set (tuple or list) to be included in the
  388.     #     canonized image or None if all document nodes should be
  389.     #     included.
  390.     #   exclusive: the exclusive flag (0 - non-exclusive
  391.     #     canonicalization; otherwise - exclusive canonicalization)
  392.     #   prefixes: the list of inclusive namespace prefixes (strings),
  393.     #     or None if there is no inclusive namespaces (only for
  394.     #     exclusive canonicalization, ignored otherwise)
  395.     #   with_comments: include comments in the result (!=0) or not
  396.     #     (==0)
  397.     def c14nMemory(self,
  398.                    nodes=None,
  399.                    exclusive=0,
  400.                    prefixes=None,
  401.                    with_comments=0):
  402.         if nodes:
  403.             nodes = map(lambda n: n._o, nodes)
  404.         return libxml2mod.xmlC14NDocDumpMemory(
  405.             self.get_doc()._o,
  406.             nodes,
  407.             exclusive != 0,
  408.             prefixes,
  409.             with_comments != 0)
  410.     def c14nSaveTo(self,
  411.                    file,
  412.                    nodes=None,
  413.                    exclusive=0,
  414.                    prefixes=None,
  415.                    with_comments=0):
  416.         if nodes:
  417.             nodes = map(lambda n: n._o, nodes)
  418.         return libxml2mod.xmlC14NDocSaveTo(
  419.             self.get_doc()._o,
  420.             nodes,
  421.             exclusive != 0,
  422.             prefixes,
  423.             with_comments != 0,
  424.             file)
  425.  
  426.     #
  427.     # Selecting nodes using XPath, a bit slow because the context
  428.     # is allocated/freed every time but convenient.
  429.     #
  430.     def xpathEval(self, expr):
  431.         doc = self.doc
  432.         if doc == None:
  433.             return None
  434.         ctxt = doc.xpathNewContext()
  435.         ctxt.setContextNode(self)
  436.         res = ctxt.xpathEval(expr)
  437.         ctxt.xpathFreeContext()
  438.         return res
  439.  
  440. #    #
  441. #    # Selecting nodes using XPath, faster because the context
  442. #    # is allocated just once per xmlDoc.
  443. #    #
  444. #    # Removed: DV memleaks c.f. #126735
  445. #    #
  446. #    def xpathEval2(self, expr):
  447. #        doc = self.doc
  448. #        if doc == None:
  449. #            return None
  450. #        try:
  451. #            doc._ctxt.setContextNode(self)
  452. #        except:
  453. #            doc._ctxt = doc.xpathNewContext()
  454. #            doc._ctxt.setContextNode(self)
  455. #        res = doc._ctxt.xpathEval(expr)
  456. #        return res
  457.     def xpathEval2(self, expr):
  458.         return self.xpathEval(expr)
  459.  
  460.     # Remove namespaces
  461.     def removeNsDef(self, href):
  462.         """
  463.         Remove a namespace definition from a node.  If href is None,
  464.         remove all of the ns definitions on that node.  The removed
  465.         namespaces are returned as a linked list.
  466.  
  467.         Note: If any child nodes referred to the removed namespaces,
  468.         they will be left with dangling links.  You should call
  469.         renciliateNs() to fix those pointers.
  470.  
  471.         Note: This method does not free memory taken by the ns
  472.         definitions.  You will need to free it manually with the
  473.         freeNsList() method on the returns xmlNs object.
  474.         """
  475.  
  476.         ret = libxml2mod.xmlNodeRemoveNsDef(self._o, href)
  477.         if ret is None:return None
  478.         __tmp = xmlNs(_obj=ret)
  479.         return __tmp
  480.  
  481.     # support for python2 iterators
  482.     def walk_depth_first(self):
  483.         return xmlCoreDepthFirstItertor(self)
  484.     def walk_breadth_first(self):
  485.         return xmlCoreBreadthFirstItertor(self)
  486.     __iter__ = walk_depth_first
  487.  
  488.     def free(self):
  489.         try:
  490.             self.doc._ctxt.xpathFreeContext()
  491.         except:
  492.             pass
  493.         libxml2mod.xmlFreeDoc(self._o)
  494.  
  495.  
  496. #
  497. # implements the depth-first iterator for libxml2 DOM tree
  498. #
  499. class xmlCoreDepthFirstItertor:
  500.     def __init__(self, node):
  501.         self.node = node
  502.         self.parents = []
  503.     def __iter__(self):
  504.         return self
  505.     def next(self):
  506.         while 1:
  507.             if self.node:
  508.                 ret = self.node
  509.                 self.parents.append(self.node)
  510.                 self.node = self.node.children
  511.                 return ret
  512.             try:
  513.                 parent = self.parents.pop()
  514.             except IndexError:
  515.                 raise StopIteration
  516.             self.node = parent.next
  517.  
  518. #
  519. # implements the breadth-first iterator for libxml2 DOM tree
  520. #
  521. class xmlCoreBreadthFirstItertor:
  522.     def __init__(self, node):
  523.         self.node = node
  524.         self.parents = []
  525.     def __iter__(self):
  526.         return self
  527.     def next(self):
  528.         while 1:
  529.             if self.node:
  530.                 ret = self.node
  531.                 self.parents.append(self.node)
  532.                 self.node = self.node.next
  533.                 return ret
  534.             try:
  535.                 parent = self.parents.pop()
  536.             except IndexError:
  537.                 raise StopIteration
  538.             self.node = parent.children
  539.  
  540. #
  541. # converters to present a nicer view of the XPath returns
  542. #
  543. def nodeWrap(o):
  544.     # TODO try to cast to the most appropriate node class
  545.     name = libxml2mod.type(o)
  546.     if name == "element" or name == "text":
  547.         return xmlNode(_obj=o)
  548.     if name == "attribute":
  549.         return xmlAttr(_obj=o)
  550.     if name[0:8] == "document":
  551.         return xmlDoc(_obj=o)
  552.     if name == "namespace":
  553.         return xmlNs(_obj=o)
  554.     if name == "elem_decl":
  555.         return xmlElement(_obj=o)
  556.     if name == "attribute_decl":
  557.         return xmlAttribute(_obj=o)
  558.     if name == "entity_decl":
  559.         return xmlEntity(_obj=o)
  560.     if name == "dtd":
  561.         return xmlDtd(_obj=o)
  562.     return xmlNode(_obj=o)
  563.  
  564. def xpathObjectRet(o):
  565.     otype = type(o)
  566.     if otype == type([]):
  567.         ret = map(xpathObjectRet, o)
  568.         return ret
  569.     elif otype == type(()):
  570.         ret = map(xpathObjectRet, o)
  571.         return tuple(ret)
  572.     elif otype == type('') or otype == type(0) or otype == type(0.0):
  573.         return o
  574.     else:
  575.         return nodeWrap(o)
  576.  
  577. #
  578. # register an XPath function
  579. #
  580. def registerXPathFunction(ctxt, name, ns_uri, f):
  581.     ret = libxml2mod.xmlRegisterXPathFunction(ctxt, name, ns_uri, f)
  582.  
  583. #
  584. # For the xmlTextReader parser configuration
  585. #
  586. PARSER_LOADDTD=1
  587. PARSER_DEFAULTATTRS=2
  588. PARSER_VALIDATE=3
  589. PARSER_SUBST_ENTITIES=4
  590.  
  591. #
  592. # For the error callback severities
  593. #
  594. PARSER_SEVERITY_VALIDITY_WARNING=1
  595. PARSER_SEVERITY_VALIDITY_ERROR=2
  596. PARSER_SEVERITY_WARNING=3
  597. PARSER_SEVERITY_ERROR=4
  598.  
  599. #
  600. # register the libxml2 error handler
  601. #
  602. def registerErrorHandler(f, ctx):
  603.     """Register a Python written function to for error reporting.
  604.        The function is called back as f(ctx, error). """
  605.     import sys
  606.     if not sys.modules.has_key('libxslt'):
  607.         # normal behaviour when libxslt is not imported
  608.         ret = libxml2mod.xmlRegisterErrorHandler(f,ctx)
  609.     else:
  610.         # when libxslt is already imported, one must
  611.         # use libxst's error handler instead
  612.         import libxslt
  613.         ret = libxslt.registerErrorHandler(f,ctx)
  614.     return ret
  615.  
  616. class parserCtxtCore:
  617.  
  618.     def __init__(self, _obj=None):
  619.         if _obj != None: 
  620.             self._o = _obj;
  621.             return
  622.         self._o = None
  623.  
  624.     def __del__(self):
  625.         if self._o != None:
  626.             libxml2mod.xmlFreeParserCtxt(self._o)
  627.         self._o = None
  628.  
  629.     def setErrorHandler(self,f,arg):
  630.         """Register an error handler that will be called back as
  631.            f(arg,msg,severity,reserved).
  632.            
  633.            @reserved is currently always None."""
  634.         libxml2mod.xmlParserCtxtSetErrorHandler(self._o,f,arg)
  635.  
  636.     def getErrorHandler(self):
  637.         """Return (f,arg) as previously registered with setErrorHandler
  638.            or (None,None)."""
  639.         return libxml2mod.xmlParserCtxtGetErrorHandler(self._o)
  640.  
  641.     def addLocalCatalog(self, uri):
  642.         """Register a local catalog with the parser"""
  643.         return libxml2mod.addLocalCatalog(self._o, uri)
  644.     
  645.  
  646. class ValidCtxtCore:
  647.  
  648.     def __init__(self, *args, **kw):
  649.         pass
  650.  
  651.     def setValidityErrorHandler(self, err_func, warn_func, arg=None):
  652.         """
  653.         Register error and warning handlers for DTD validation.
  654.         These will be called back as f(msg,arg)
  655.         """
  656.         libxml2mod.xmlSetValidErrors(self._o, err_func, warn_func, arg)
  657.     
  658.  
  659. class SchemaValidCtxtCore:
  660.  
  661.     def __init__(self, *args, **kw):
  662.         pass
  663.  
  664.     def setValidityErrorHandler(self, err_func, warn_func, arg=None):
  665.         """
  666.         Register error and warning handlers for Schema validation.
  667.         These will be called back as f(msg,arg)
  668.         """
  669.         libxml2mod.xmlSchemaSetValidErrors(self._o, err_func, warn_func, arg)
  670.  
  671.  
  672. class relaxNgValidCtxtCore:
  673.  
  674.     def __init__(self, *args, **kw):
  675.         pass
  676.  
  677.     def setValidityErrorHandler(self, err_func, warn_func, arg=None):
  678.         """
  679.         Register error and warning handlers for RelaxNG validation.
  680.         These will be called back as f(msg,arg)
  681.         """
  682.         libxml2mod.xmlRelaxNGSetValidErrors(self._o, err_func, warn_func, arg)
  683.  
  684.     
  685. def _xmlTextReaderErrorFunc((f,arg),msg,severity,locator):
  686.     """Intermediate callback to wrap the locator"""
  687.     return f(arg,msg,severity,xmlTextReaderLocator(locator))
  688.  
  689. class xmlTextReaderCore:
  690.  
  691.     def __init__(self, _obj=None):
  692.         self.input = None
  693.         if _obj != None:self._o = _obj;return
  694.         self._o = None
  695.  
  696.     def __del__(self):
  697.         if self._o != None:
  698.             libxml2mod.xmlFreeTextReader(self._o)
  699.         self._o = None
  700.  
  701.     def SetErrorHandler(self,f,arg):
  702.         """Register an error handler that will be called back as
  703.            f(arg,msg,severity,locator)."""
  704.         if f is None:
  705.             libxml2mod.xmlTextReaderSetErrorHandler(\
  706.                 self._o,None,None)
  707.         else:
  708.             libxml2mod.xmlTextReaderSetErrorHandler(\
  709.                 self._o,_xmlTextReaderErrorFunc,(f,arg))
  710.  
  711.     def GetErrorHandler(self):
  712.         """Return (f,arg) as previously registered with setErrorHandler
  713.            or (None,None)."""
  714.         f,arg = libxml2mod.xmlTextReaderGetErrorHandler(self._o)
  715.         if f is None:
  716.             return None,None
  717.         else:
  718.             # assert f is _xmlTextReaderErrorFunc
  719.             return arg
  720.  
  721. #
  722. # The cleanup now goes though a wrappe in libxml.c
  723. #
  724. def cleanupParser():
  725.     libxml2mod.xmlPythonCleanupParser()
  726.  
  727. # WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
  728. #
  729. # Everything before this line comes from libxml.py 
  730. # Everything after this line is automatically generated
  731. #
  732. # WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
  733.  
  734. #
  735. # Functions from module HTMLparser
  736. #
  737.  
  738. def htmlCreateMemoryParserCtxt(buffer, size):
  739.     """Create a parser context for an HTML in-memory document. """
  740.     ret = libxml2mod.htmlCreateMemoryParserCtxt(buffer, size)
  741.     if ret is None:raise parserError('htmlCreateMemoryParserCtxt() failed')
  742.     return parserCtxt(_obj=ret)
  743.  
  744. def htmlHandleOmittedElem(val):
  745.     """Set and return the previous value for handling HTML omitted
  746.        tags. """
  747.     ret = libxml2mod.htmlHandleOmittedElem(val)
  748.     return ret
  749.  
  750. def htmlIsScriptAttribute(name):
  751.     """Check if an attribute is of content type Script """
  752.     ret = libxml2mod.htmlIsScriptAttribute(name)
  753.     return ret
  754.  
  755. def htmlNewParserCtxt():
  756.     """Allocate and initialize a new parser context. """
  757.     ret = libxml2mod.htmlNewParserCtxt()
  758.     if ret is None:raise parserError('htmlNewParserCtxt() failed')
  759.     return parserCtxt(_obj=ret)
  760.  
  761. def htmlParseDoc(cur, encoding):
  762.     """parse an HTML in-memory document and build a tree. """
  763.     ret = libxml2mod.htmlParseDoc(cur, encoding)
  764.     if ret is None:raise parserError('htmlParseDoc() failed')
  765.     return xmlDoc(_obj=ret)
  766.  
  767. def htmlParseFile(filename, encoding):
  768.     """parse an HTML file and build a tree. Automatic support for
  769.       ZLIB/Compress compressed document is provided by default if
  770.        found at compile-time. """
  771.     ret = libxml2mod.htmlParseFile(filename, encoding)
  772.     if ret is None:raise parserError('htmlParseFile() failed')
  773.     return xmlDoc(_obj=ret)
  774.  
  775. def htmlReadDoc(cur, URL, encoding, options):
  776.     """parse an XML in-memory document and build a tree. """
  777.     ret = libxml2mod.htmlReadDoc(cur, URL, encoding, options)
  778.     if ret is None:raise treeError('htmlReadDoc() failed')
  779.     return xmlDoc(_obj=ret)
  780.  
  781. def htmlReadFd(fd, URL, encoding, options):
  782.     """parse an XML from a file descriptor and build a tree. """
  783.     ret = libxml2mod.htmlReadFd(fd, URL, encoding, options)
  784.     if ret is None:raise treeError('htmlReadFd() failed')
  785.     return xmlDoc(_obj=ret)
  786.  
  787. def htmlReadFile(filename, encoding, options):
  788.     """parse an XML file from the filesystem or the network. """
  789.     ret = libxml2mod.htmlReadFile(filename, encoding, options)
  790.     if ret is None:raise treeError('htmlReadFile() failed')
  791.     return xmlDoc(_obj=ret)
  792.  
  793. def htmlReadMemory(buffer, size, URL, encoding, options):
  794.     """parse an XML in-memory document and build a tree. """
  795.     ret = libxml2mod.htmlReadMemory(buffer, size, URL, encoding, options)
  796.     if ret is None:raise treeError('htmlReadMemory() failed')
  797.     return xmlDoc(_obj=ret)
  798.  
  799. #
  800. # Functions from module HTMLtree
  801. #
  802.  
  803. def htmlIsBooleanAttr(name):
  804.     """Determine if a given attribute is a boolean attribute. """
  805.     ret = libxml2mod.htmlIsBooleanAttr(name)
  806.     return ret
  807.  
  808. def htmlNewDoc(URI, ExternalID):
  809.     """Creates a new HTML document """
  810.     ret = libxml2mod.htmlNewDoc(URI, ExternalID)
  811.     if ret is None:raise treeError('htmlNewDoc() failed')
  812.     return xmlDoc(_obj=ret)
  813.  
  814. def htmlNewDocNoDtD(URI, ExternalID):
  815.     """Creates a new HTML document without a DTD node if @URI and
  816.        @ExternalID are None """
  817.     ret = libxml2mod.htmlNewDocNoDtD(URI, ExternalID)
  818.     if ret is None:raise treeError('htmlNewDocNoDtD() failed')
  819.     return xmlDoc(_obj=ret)
  820.  
  821. #
  822. # Functions from module SAX2
  823. #
  824.  
  825. def SAXDefaultVersion(version):
  826.     """Set the default version of SAX used globally by the
  827.       library. By default, during initialization the default is
  828.       set to 2. Note that it is generally a better coding style
  829.       to use xmlSAXVersion() to set up the version explicitly for
  830.        a given parsing context. """
  831.     ret = libxml2mod.xmlSAXDefaultVersion(version)
  832.     return ret
  833.  
  834. def defaultSAXHandlerInit():
  835.     """Initialize the default SAX2 handler """
  836.     libxml2mod.xmlDefaultSAXHandlerInit()
  837.  
  838. def docbDefaultSAXHandlerInit():
  839.     """Initialize the default SAX handler """
  840.     libxml2mod.docbDefaultSAXHandlerInit()
  841.  
  842. def htmlDefaultSAXHandlerInit():
  843.     """Initialize the default SAX handler """
  844.     libxml2mod.htmlDefaultSAXHandlerInit()
  845.  
  846. #
  847. # Functions from module catalog
  848. #
  849.  
  850. def catalogAdd(type, orig, replace):
  851.     """Add an entry in the catalog, it may overwrite existing but
  852.       different entries. If called before any other catalog
  853.       routine, allows to override the default shared catalog put
  854.        in place by xmlInitializeCatalog(); """
  855.     ret = libxml2mod.xmlCatalogAdd(type, orig, replace)
  856.     return ret
  857.  
  858. def catalogCleanup():
  859.     """Free up all the memory associated with catalogs """
  860.     libxml2mod.xmlCatalogCleanup()
  861.  
  862. def catalogConvert():
  863.     """Convert all the SGML catalog entries as XML ones """
  864.     ret = libxml2mod.xmlCatalogConvert()
  865.     return ret
  866.  
  867. def catalogDump(out):
  868.     """Dump all the global catalog content to the given file. """
  869.     libxml2mod.xmlCatalogDump(out)
  870.  
  871. def catalogGetPublic(pubID):
  872.     """Try to lookup the catalog reference associated to a public
  873.        ID DEPRECATED, use xmlCatalogResolvePublic() """
  874.     ret = libxml2mod.xmlCatalogGetPublic(pubID)
  875.     return ret
  876.  
  877. def catalogGetSystem(sysID):
  878.     """Try to lookup the catalog reference associated to a system
  879.        ID DEPRECATED, use xmlCatalogResolveSystem() """
  880.     ret = libxml2mod.xmlCatalogGetSystem(sysID)
  881.     return ret
  882.  
  883. def catalogRemove(value):
  884.     """Remove an entry from the catalog """
  885.     ret = libxml2mod.xmlCatalogRemove(value)
  886.     return ret
  887.  
  888. def catalogResolve(pubID, sysID):
  889.     """Do a complete resolution lookup of an External Identifier """
  890.     ret = libxml2mod.xmlCatalogResolve(pubID, sysID)
  891.     return ret
  892.  
  893. def catalogResolvePublic(pubID):
  894.     """Try to lookup the catalog reference associated to a public
  895.        ID """
  896.     ret = libxml2mod.xmlCatalogResolvePublic(pubID)
  897.     return ret
  898.  
  899. def catalogResolveSystem(sysID):
  900.     """Try to lookup the catalog resource for a system ID """
  901.     ret = libxml2mod.xmlCatalogResolveSystem(sysID)
  902.     return ret
  903.  
  904. def catalogResolveURI(URI):
  905.     """Do a complete resolution lookup of an URI """
  906.     ret = libxml2mod.xmlCatalogResolveURI(URI)
  907.     return ret
  908.  
  909. def catalogSetDebug(level):
  910.     """Used to set the debug level for catalog operation, 0
  911.        disable debugging, 1 enable it """
  912.     ret = libxml2mod.xmlCatalogSetDebug(level)
  913.     return ret
  914.  
  915. def initializeCatalog():
  916.     """Do the catalog initialization. this function is not thread
  917.       safe, catalog initialization should preferably be done once
  918.        at startup """
  919.     libxml2mod.xmlInitializeCatalog()
  920.  
  921. def loadACatalog(filename):
  922.     """Load the catalog and build the associated data structures.
  923.       This can be either an XML Catalog or an SGML Catalog It
  924.       will recurse in SGML CATALOG entries. On the other hand XML
  925.        Catalogs are not handled recursively. """
  926.     ret = libxml2mod.xmlLoadACatalog(filename)
  927.     if ret is None:raise treeError('xmlLoadACatalog() failed')
  928.     return catalog(_obj=ret)
  929.  
  930. def loadCatalog(filename):
  931.     """Load the catalog and makes its definitions effective for
  932.       the default external entity loader. It will recurse in SGML
  933.       CATALOG entries. this function is not thread safe, catalog
  934.        initialization should preferably be done once at startup """
  935.     ret = libxml2mod.xmlLoadCatalog(filename)
  936.     return ret
  937.  
  938. def loadCatalogs(pathss):
  939.     """Load the catalogs and makes their definitions effective for
  940.       the default external entity loader. this function is not
  941.       thread safe, catalog initialization should preferably be
  942.        done once at startup """
  943.     libxml2mod.xmlLoadCatalogs(pathss)
  944.  
  945. def loadSGMLSuperCatalog(filename):
  946.     """Load an SGML super catalog. It won't expand CATALOG or
  947.       DELEGATE references. This is only needed for manipulating
  948.       SGML Super Catalogs like adding and removing CATALOG or
  949.        DELEGATE entries. """
  950.     ret = libxml2mod.xmlLoadSGMLSuperCatalog(filename)
  951.     if ret is None:raise treeError('xmlLoadSGMLSuperCatalog() failed')
  952.     return catalog(_obj=ret)
  953.  
  954. def newCatalog(sgml):
  955.     """create a new Catalog. """
  956.     ret = libxml2mod.xmlNewCatalog(sgml)
  957.     if ret is None:raise treeError('xmlNewCatalog() failed')
  958.     return catalog(_obj=ret)
  959.  
  960. def parseCatalogFile(filename):
  961.     """parse an XML file and build a tree. It's like
  962.        xmlParseFile() except it bypass all catalog lookups. """
  963.     ret = libxml2mod.xmlParseCatalogFile(filename)
  964.     if ret is None:raise parserError('xmlParseCatalogFile() failed')
  965.     return xmlDoc(_obj=ret)
  966.  
  967. #
  968. # Functions from module chvalid
  969. #
  970.  
  971. def isBaseChar(ch):
  972.     """This function is DEPRECATED. Use xmlIsBaseChar_ch or
  973.        xmlIsBaseCharQ instead """
  974.     ret = libxml2mod.xmlIsBaseChar(ch)
  975.     return ret
  976.  
  977. def isBlank(ch):
  978.     """This function is DEPRECATED. Use xmlIsBlank_ch or
  979.        xmlIsBlankQ instead """
  980.     ret = libxml2mod.xmlIsBlank(ch)
  981.     return ret
  982.  
  983. def isChar(ch):
  984.     """This function is DEPRECATED. Use xmlIsChar_ch or xmlIsCharQ
  985.        instead """
  986.     ret = libxml2mod.xmlIsChar(ch)
  987.     return ret
  988.  
  989. def isCombining(ch):
  990.     """This function is DEPRECATED. Use xmlIsCombiningQ instead """
  991.     ret = libxml2mod.xmlIsCombining(ch)
  992.     return ret
  993.  
  994. def isDigit(ch):
  995.     """This function is DEPRECATED. Use xmlIsDigit_ch or
  996.        xmlIsDigitQ instead """
  997.     ret = libxml2mod.xmlIsDigit(ch)
  998.     return ret
  999.  
  1000. def isExtender(ch):
  1001.     """This function is DEPRECATED. Use xmlIsExtender_ch or
  1002.        xmlIsExtenderQ instead """
  1003.     ret = libxml2mod.xmlIsExtender(ch)
  1004.     return ret
  1005.  
  1006. def isIdeographic(ch):
  1007.     """This function is DEPRECATED. Use xmlIsIdeographicQ instead """
  1008.     ret = libxml2mod.xmlIsIdeographic(ch)
  1009.     return ret
  1010.  
  1011. def isPubidChar(ch):
  1012.     """This function is DEPRECATED. Use xmlIsPubidChar_ch or
  1013.        xmlIsPubidCharQ instead """
  1014.     ret = libxml2mod.xmlIsPubidChar(ch)
  1015.     return ret
  1016.  
  1017. #
  1018. # Functions from module debugXML
  1019. #
  1020.  
  1021. def boolToText(boolval):
  1022.     """Convenient way to turn bool into text """
  1023.     ret = libxml2mod.xmlBoolToText(boolval)
  1024.     return ret
  1025.  
  1026. def debugDumpString(output, str):
  1027.     """Dumps informations about the string, shorten it if necessary """
  1028.     libxml2mod.xmlDebugDumpString(output, str)
  1029.  
  1030. def shellPrintXPathError(errorType, arg):
  1031.     """Print the xpath error to libxml default error channel """
  1032.     libxml2mod.xmlShellPrintXPathError(errorType, arg)
  1033.  
  1034. #
  1035. # Functions from module dict
  1036. #
  1037.  
  1038. def dictCleanup():
  1039.     """Free the dictionary mutex. """
  1040.     libxml2mod.xmlDictCleanup()
  1041.  
  1042. #
  1043. # Functions from module encoding
  1044. #
  1045.  
  1046. def addEncodingAlias(name, alias):
  1047.     """Registers an alias @alias for an encoding named @name.
  1048.        Existing alias will be overwritten. """
  1049.     ret = libxml2mod.xmlAddEncodingAlias(name, alias)
  1050.     return ret
  1051.  
  1052. def cleanupCharEncodingHandlers():
  1053.     """Cleanup the memory allocated for the char encoding support,
  1054.        it unregisters all the encoding handlers and the aliases. """
  1055.     libxml2mod.xmlCleanupCharEncodingHandlers()
  1056.  
  1057. def cleanupEncodingAliases():
  1058.     """Unregisters all aliases """
  1059.     libxml2mod.xmlCleanupEncodingAliases()
  1060.  
  1061. def delEncodingAlias(alias):
  1062.     """Unregisters an encoding alias @alias """
  1063.     ret = libxml2mod.xmlDelEncodingAlias(alias)
  1064.     return ret
  1065.  
  1066. def encodingAlias(alias):
  1067.     """Lookup an encoding name for the given alias. """
  1068.     ret = libxml2mod.xmlGetEncodingAlias(alias)
  1069.     return ret
  1070.  
  1071. def initCharEncodingHandlers():
  1072.     """Initialize the char encoding support, it registers the
  1073.       default encoding supported. NOTE: while public, this
  1074.       function usually doesn't need to be called in normal
  1075.        processing. """
  1076.     libxml2mod.xmlInitCharEncodingHandlers()
  1077.  
  1078. #
  1079. # Functions from module entities
  1080. #
  1081.  
  1082. def cleanupPredefinedEntities():
  1083.     """Cleanup up the predefined entities table. Deprecated call """
  1084.     libxml2mod.xmlCleanupPredefinedEntities()
  1085.  
  1086. def initializePredefinedEntities():
  1087.     """Set up the predefined entities. Deprecated call """
  1088.     libxml2mod.xmlInitializePredefinedEntities()
  1089.  
  1090. def predefinedEntity(name):
  1091.     """Check whether this name is an predefined entity. """
  1092.     ret = libxml2mod.xmlGetPredefinedEntity(name)
  1093.     if ret is None:raise treeError('xmlGetPredefinedEntity() failed')
  1094.     return xmlEntity(_obj=ret)
  1095.  
  1096. #
  1097. # Functions from module globals
  1098. #
  1099.  
  1100. def cleanupGlobals():
  1101.     """Additional cleanup for multi-threading """
  1102.     libxml2mod.xmlCleanupGlobals()
  1103.  
  1104. def initGlobals():
  1105.     """Additional initialisation for multi-threading """
  1106.     libxml2mod.xmlInitGlobals()
  1107.  
  1108. def thrDefDefaultBufferSize(v):
  1109.     ret = libxml2mod.xmlThrDefDefaultBufferSize(v)
  1110.     return ret
  1111.  
  1112. def thrDefDoValidityCheckingDefaultValue(v):
  1113.     ret = libxml2mod.xmlThrDefDoValidityCheckingDefaultValue(v)
  1114.     return ret
  1115.  
  1116. def thrDefGetWarningsDefaultValue(v):
  1117.     ret = libxml2mod.xmlThrDefGetWarningsDefaultValue(v)
  1118.     return ret
  1119.  
  1120. def thrDefIndentTreeOutput(v):
  1121.     ret = libxml2mod.xmlThrDefIndentTreeOutput(v)
  1122.     return ret
  1123.  
  1124. def thrDefKeepBlanksDefaultValue(v):
  1125.     ret = libxml2mod.xmlThrDefKeepBlanksDefaultValue(v)
  1126.     return ret
  1127.  
  1128. def thrDefLineNumbersDefaultValue(v):
  1129.     ret = libxml2mod.xmlThrDefLineNumbersDefaultValue(v)
  1130.     return ret
  1131.  
  1132. def thrDefLoadExtDtdDefaultValue(v):
  1133.     ret = libxml2mod.xmlThrDefLoadExtDtdDefaultValue(v)
  1134.     return ret
  1135.  
  1136. def thrDefParserDebugEntities(v):
  1137.     ret = libxml2mod.xmlThrDefParserDebugEntities(v)
  1138.     return ret
  1139.  
  1140. def thrDefPedanticParserDefaultValue(v):
  1141.     ret = libxml2mod.xmlThrDefPedanticParserDefaultValue(v)
  1142.     return ret
  1143.  
  1144. def thrDefSaveNoEmptyTags(v):
  1145.     ret = libxml2mod.xmlThrDefSaveNoEmptyTags(v)
  1146.     return ret
  1147.  
  1148. def thrDefSubstituteEntitiesDefaultValue(v):
  1149.     ret = libxml2mod.xmlThrDefSubstituteEntitiesDefaultValue(v)
  1150.     return ret
  1151.  
  1152. def thrDefTreeIndentString(v):
  1153.     ret = libxml2mod.xmlThrDefTreeIndentString(v)
  1154.     return ret
  1155.  
  1156. #
  1157. # Functions from module nanoftp
  1158. #
  1159.  
  1160. def nanoFTPCleanup():
  1161.     """Cleanup the FTP protocol layer. This cleanup proxy
  1162.        informations. """
  1163.     libxml2mod.xmlNanoFTPCleanup()
  1164.  
  1165. def nanoFTPInit():
  1166.     """Initialize the FTP protocol layer. Currently it just checks
  1167.        for proxy informations, and get the hostname """
  1168.     libxml2mod.xmlNanoFTPInit()
  1169.  
  1170. def nanoFTPProxy(host, port, user, passwd, type):
  1171.     """Setup the FTP proxy informations. This can also be done by
  1172.       using ftp_proxy ftp_proxy_user and ftp_proxy_password
  1173.        environment variables. """
  1174.     libxml2mod.xmlNanoFTPProxy(host, port, user, passwd, type)
  1175.  
  1176. def nanoFTPScanProxy(URL):
  1177.     """(Re)Initialize the FTP Proxy context by parsing the URL and
  1178.       finding the protocol host port it indicates. Should be like
  1179.       ftp://myproxy/ or ftp://myproxy:3128/ A None URL cleans up
  1180.        proxy informations. """
  1181.     libxml2mod.xmlNanoFTPScanProxy(URL)
  1182.  
  1183. #
  1184. # Functions from module nanohttp
  1185. #
  1186.  
  1187. def nanoHTTPCleanup():
  1188.     """Cleanup the HTTP protocol layer. """
  1189.     libxml2mod.xmlNanoHTTPCleanup()
  1190.  
  1191. def nanoHTTPInit():
  1192.     """Initialize the HTTP protocol layer. Currently it just
  1193.        checks for proxy informations """
  1194.     libxml2mod.xmlNanoHTTPInit()
  1195.  
  1196. def nanoHTTPScanProxy(URL):
  1197.     """(Re)Initialize the HTTP Proxy context by parsing the URL
  1198.       and finding the protocol host port it indicates. Should be
  1199.       like http://myproxy/ or http://myproxy:3128/ A None URL
  1200.        cleans up proxy informations. """
  1201.     libxml2mod.xmlNanoHTTPScanProxy(URL)
  1202.  
  1203. #
  1204. # Functions from module parser
  1205. #
  1206.  
  1207. def createDocParserCtxt(cur):
  1208.     """Creates a parser context for an XML in-memory document. """
  1209.     ret = libxml2mod.xmlCreateDocParserCtxt(cur)
  1210.     if ret is None:raise parserError('xmlCreateDocParserCtxt() failed')
  1211.     return parserCtxt(_obj=ret)
  1212.  
  1213. def initParser():
  1214.     """Initialization function for the XML parser. This is not
  1215.       reentrant. Call once before processing in case of use in
  1216.        multithreaded programs. """
  1217.     libxml2mod.xmlInitParser()
  1218.  
  1219. def keepBlanksDefault(val):
  1220.     """Set and return the previous value for default blanks text
  1221.       nodes support. The 1.x version of the parser used an
  1222.       heuristic to try to detect ignorable white spaces. As a
  1223.       result the SAX callback was generating
  1224.       xmlSAX2IgnorableWhitespace() callbacks instead of
  1225.       characters() one, and when using the DOM output text nodes
  1226.       containing those blanks were not generated. The 2.x and
  1227.       later version will switch to the XML standard way and
  1228.       ignorableWhitespace() are only generated when running the
  1229.       parser in validating mode and when the current element
  1230.       doesn't allow CDATA or mixed content. This function is
  1231.       provided as a way to force the standard behavior on 1.X
  1232.       libs and to switch back to the old mode for compatibility
  1233.       when running 1.X client code on 2.X . Upgrade of 1.X code
  1234.       should be done by using xmlIsBlankNode() commodity function
  1235.       to detect the "empty" nodes generated. This value also
  1236.       affect autogeneration of indentation when saving code if
  1237.        blanks sections are kept, indentation is not generated. """
  1238.     ret = libxml2mod.xmlKeepBlanksDefault(val)
  1239.     return ret
  1240.  
  1241. def lineNumbersDefault(val):
  1242.     """Set and return the previous value for enabling line numbers
  1243.       in elements contents. This may break on old application and
  1244.        is turned off by default. """
  1245.     ret = libxml2mod.xmlLineNumbersDefault(val)
  1246.     return ret
  1247.  
  1248. def newParserCtxt():
  1249.     """Allocate and initialize a new parser context. """
  1250.     ret = libxml2mod.xmlNewParserCtxt()
  1251.     if ret is None:raise parserError('xmlNewParserCtxt() failed')
  1252.     return parserCtxt(_obj=ret)
  1253.  
  1254. def parseDTD(ExternalID, SystemID):
  1255.     """Load and parse an external subset. """
  1256.     ret = libxml2mod.xmlParseDTD(ExternalID, SystemID)
  1257.     if ret is None:raise parserError('xmlParseDTD() failed')
  1258.     return xmlDtd(_obj=ret)
  1259.  
  1260. def parseDoc(cur):
  1261.     """parse an XML in-memory document and build a tree. """
  1262.     ret = libxml2mod.xmlParseDoc(cur)
  1263.     if ret is None:raise parserError('xmlParseDoc() failed')
  1264.     return xmlDoc(_obj=ret)
  1265.  
  1266. def parseEntity(filename):
  1267.     """parse an XML external entity out of context and build a
  1268.       tree.  [78] extParsedEnt ::= TextDecl? content  This
  1269.        correspond to a "Well Balanced" chunk """
  1270.     ret = libxml2mod.xmlParseEntity(filename)
  1271.     if ret is None:raise parserError('xmlParseEntity() failed')
  1272.     return xmlDoc(_obj=ret)
  1273.  
  1274. def parseFile(filename):
  1275.     """parse an XML file and build a tree. Automatic support for
  1276.       ZLIB/Compress compressed document is provided by default if
  1277.        found at compile-time. """
  1278.     ret = libxml2mod.xmlParseFile(filename)
  1279.     if ret is None:raise parserError('xmlParseFile() failed')
  1280.     return xmlDoc(_obj=ret)
  1281.  
  1282. def parseMemory(buffer, size):
  1283.     """parse an XML in-memory block and build a tree. """
  1284.     ret = libxml2mod.xmlParseMemory(buffer, size)
  1285.     if ret is None:raise parserError('xmlParseMemory() failed')
  1286.     return xmlDoc(_obj=ret)
  1287.  
  1288. def pedanticParserDefault(val):
  1289.     """Set and return the previous value for enabling pedantic
  1290.        warnings. """
  1291.     ret = libxml2mod.xmlPedanticParserDefault(val)
  1292.     return ret
  1293.  
  1294. def readDoc(cur, URL, encoding, options):
  1295.     """parse an XML in-memory document and build a tree. """
  1296.     ret = libxml2mod.xmlReadDoc(cur, URL, encoding, options)
  1297.     if ret is None:raise treeError('xmlReadDoc() failed')
  1298.     return xmlDoc(_obj=ret)
  1299.  
  1300. def readFd(fd, URL, encoding, options):
  1301.     """parse an XML from a file descriptor and build a tree. NOTE
  1302.       that the file descriptor will not be closed when the reader
  1303.        is closed or reset. """
  1304.     ret = libxml2mod.xmlReadFd(fd, URL, encoding, options)
  1305.     if ret is None:raise treeError('xmlReadFd() failed')
  1306.     return xmlDoc(_obj=ret)
  1307.  
  1308. def readFile(filename, encoding, options):
  1309.     """parse an XML file from the filesystem or the network. """
  1310.     ret = libxml2mod.xmlReadFile(filename, encoding, options)
  1311.     if ret is None:raise treeError('xmlReadFile() failed')
  1312.     return xmlDoc(_obj=ret)
  1313.  
  1314. def readMemory(buffer, size, URL, encoding, options):
  1315.     """parse an XML in-memory document and build a tree. """
  1316.     ret = libxml2mod.xmlReadMemory(buffer, size, URL, encoding, options)
  1317.     if ret is None:raise treeError('xmlReadMemory() failed')
  1318.     return xmlDoc(_obj=ret)
  1319.  
  1320. def recoverDoc(cur):
  1321.     """parse an XML in-memory document and build a tree. In the
  1322.       case the document is not Well Formed, a attempt to build a
  1323.        tree is tried anyway """
  1324.     ret = libxml2mod.xmlRecoverDoc(cur)
  1325.     if ret is None:raise treeError('xmlRecoverDoc() failed')
  1326.     return xmlDoc(_obj=ret)
  1327.  
  1328. def recoverFile(filename):
  1329.     """parse an XML file and build a tree. Automatic support for
  1330.       ZLIB/Compress compressed document is provided by default if
  1331.       found at compile-time. In the case the document is not Well
  1332.        Formed, it attempts to build a tree anyway """
  1333.     ret = libxml2mod.xmlRecoverFile(filename)
  1334.     if ret is None:raise treeError('xmlRecoverFile() failed')
  1335.     return xmlDoc(_obj=ret)
  1336.  
  1337. def recoverMemory(buffer, size):
  1338.     """parse an XML in-memory block and build a tree. In the case
  1339.       the document is not Well Formed, an attempt to build a tree
  1340.        is tried anyway """
  1341.     ret = libxml2mod.xmlRecoverMemory(buffer, size)
  1342.     if ret is None:raise treeError('xmlRecoverMemory() failed')
  1343.     return xmlDoc(_obj=ret)
  1344.  
  1345. def substituteEntitiesDefault(val):
  1346.     """Set and return the previous value for default entity
  1347.       support. Initially the parser always keep entity references
  1348.       instead of substituting entity values in the output. This
  1349.       function has to be used to change the default parser
  1350.       behavior SAX::substituteEntities() has to be used for
  1351.        changing that on a file by file basis. """
  1352.     ret = libxml2mod.xmlSubstituteEntitiesDefault(val)
  1353.     return ret
  1354.  
  1355. #
  1356. # Functions from module parserInternals
  1357. #
  1358.  
  1359. def checkLanguageID(lang):
  1360.     """Checks that the value conforms to the LanguageID
  1361.       production:  NOTE: this is somewhat deprecated, those
  1362.       productions were removed from the XML Second edition.  [33]
  1363.       LanguageID ::= Langcode ('-' Subcode)* [34] Langcode ::=
  1364.       ISO639Code |  IanaCode |  UserCode [35] ISO639Code ::=
  1365.       ([a-z] | [A-Z]) ([a-z] | [A-Z]) [36] IanaCode ::= ('i' |
  1366.       'I') '-' ([a-z] | [A-Z])+ [37] UserCode ::= ('x' | 'X') '-'
  1367.        ([a-z] | [A-Z])+ [38] Subcode ::= ([a-z] | [A-Z])+ """
  1368.     ret = libxml2mod.xmlCheckLanguageID(lang)
  1369.     return ret
  1370.  
  1371. def copyChar(len, out, val):
  1372.     """append the char value in the array """
  1373.     ret = libxml2mod.xmlCopyChar(len, out, val)
  1374.     return ret
  1375.  
  1376. def copyCharMultiByte(out, val):
  1377.     """append the char value in the array """
  1378.     ret = libxml2mod.xmlCopyCharMultiByte(out, val)
  1379.     return ret
  1380.  
  1381. def createEntityParserCtxt(URL, ID, base):
  1382.     """Create a parser context for an external entity Automatic
  1383.       support for ZLIB/Compress compressed document is provided
  1384.        by default if found at compile-time. """
  1385.     ret = libxml2mod.xmlCreateEntityParserCtxt(URL, ID, base)
  1386.     if ret is None:raise parserError('xmlCreateEntityParserCtxt() failed')
  1387.     return parserCtxt(_obj=ret)
  1388.  
  1389. def createFileParserCtxt(filename):
  1390.     """Create a parser context for a file content. Automatic
  1391.       support for ZLIB/Compress compressed document is provided
  1392.        by default if found at compile-time. """
  1393.     ret = libxml2mod.xmlCreateFileParserCtxt(filename)
  1394.     if ret is None:raise parserError('xmlCreateFileParserCtxt() failed')
  1395.     return parserCtxt(_obj=ret)
  1396.  
  1397. def createMemoryParserCtxt(buffer, size):
  1398.     """Create a parser context for an XML in-memory document. """
  1399.     ret = libxml2mod.xmlCreateMemoryParserCtxt(buffer, size)
  1400.     if ret is None:raise parserError('xmlCreateMemoryParserCtxt() failed')
  1401.     return parserCtxt(_obj=ret)
  1402.  
  1403. def createURLParserCtxt(filename, options):
  1404.     """Create a parser context for a file or URL content.
  1405.       Automatic support for ZLIB/Compress compressed document is
  1406.       provided by default if found at compile-time and for file
  1407.        accesses """
  1408.     ret = libxml2mod.xmlCreateURLParserCtxt(filename, options)
  1409.     if ret is None:raise parserError('xmlCreateURLParserCtxt() failed')
  1410.     return parserCtxt(_obj=ret)
  1411.  
  1412. def htmlCreateFileParserCtxt(filename, encoding):
  1413.     """Create a parser context for a file content. Automatic
  1414.       support for ZLIB/Compress compressed document is provided
  1415.        by default if found at compile-time. """
  1416.     ret = libxml2mod.htmlCreateFileParserCtxt(filename, encoding)
  1417.     if ret is None:raise parserError('htmlCreateFileParserCtxt() failed')
  1418.     return parserCtxt(_obj=ret)
  1419.  
  1420. def htmlInitAutoClose():
  1421.     """Initialize the htmlStartCloseIndex for fast lookup of
  1422.       closing tags names. This is not reentrant. Call
  1423.       xmlInitParser() once before processing in case of use in
  1424.        multithreaded programs. """
  1425.     libxml2mod.htmlInitAutoClose()
  1426.  
  1427. def isLetter(c):
  1428.     """Check whether the character is allowed by the production
  1429.        [84] Letter ::= BaseChar | Ideographic """
  1430.     ret = libxml2mod.xmlIsLetter(c)
  1431.     return ret
  1432.  
  1433. def namePop(ctxt):
  1434.     """Pops the top element name from the name stack """
  1435.     if ctxt is None: ctxt__o = None
  1436.     else: ctxt__o = ctxt._o
  1437.     ret = libxml2mod.namePop(ctxt__o)
  1438.     return ret
  1439.  
  1440. def namePush(ctxt, value):
  1441.     """Pushes a new element name on top of the name stack """
  1442.     if ctxt is None: ctxt__o = None
  1443.     else: ctxt__o = ctxt._o
  1444.     ret = libxml2mod.namePush(ctxt__o, value)
  1445.     return ret
  1446.  
  1447. def nodePop(ctxt):
  1448.     """Pops the top element node from the node stack """
  1449.     if ctxt is None: ctxt__o = None
  1450.     else: ctxt__o = ctxt._o
  1451.     ret = libxml2mod.nodePop(ctxt__o)
  1452.     if ret is None:raise treeError('nodePop() failed')
  1453.     return xmlNode(_obj=ret)
  1454.  
  1455. def nodePush(ctxt, value):
  1456.     """Pushes a new element node on top of the node stack """
  1457.     if ctxt is None: ctxt__o = None
  1458.     else: ctxt__o = ctxt._o
  1459.     if value is None: value__o = None
  1460.     else: value__o = value._o
  1461.     ret = libxml2mod.nodePush(ctxt__o, value__o)
  1462.     return ret
  1463.  
  1464. #
  1465. # Functions from module python
  1466. #
  1467.  
  1468. def SAXParseFile(SAX, URI, recover):
  1469.     """Interface to parse an XML file or resource pointed by an
  1470.        URI to build an event flow to the SAX object """
  1471.     libxml2mod.xmlSAXParseFile(SAX, URI, recover)
  1472.  
  1473. def createInputBuffer(file, encoding):
  1474.     """Create a libxml2 input buffer from a Python file """
  1475.     ret = libxml2mod.xmlCreateInputBuffer(file, encoding)
  1476.     if ret is None:raise treeError('xmlCreateInputBuffer() failed')
  1477.     return inputBuffer(_obj=ret)
  1478.  
  1479. def createOutputBuffer(file, encoding):
  1480.     """Create a libxml2 output buffer from a Python file """
  1481.     ret = libxml2mod.xmlCreateOutputBuffer(file, encoding)
  1482.     if ret is None:raise treeError('xmlCreateOutputBuffer() failed')
  1483.     return outputBuffer(_obj=ret)
  1484.  
  1485. def createPushParser(SAX, chunk, size, URI):
  1486.     """Create a progressive XML parser context to build either an
  1487.       event flow if the SAX object is not None, or a DOM tree
  1488.        otherwise. """
  1489.     ret = libxml2mod.xmlCreatePushParser(SAX, chunk, size, URI)
  1490.     if ret is None:raise parserError('xmlCreatePushParser() failed')
  1491.     return parserCtxt(_obj=ret)
  1492.  
  1493. def debugMemory(activate):
  1494.     """Switch on the generation of line number for elements nodes.
  1495.       Also returns the number of bytes allocated and not freed by
  1496.        libxml2 since memory debugging was switched on. """
  1497.     ret = libxml2mod.xmlDebugMemory(activate)
  1498.     return ret
  1499.  
  1500. def dumpMemory():
  1501.     """dump the memory allocated in the file .memdump """
  1502.     libxml2mod.xmlDumpMemory()
  1503.  
  1504. def htmlCreatePushParser(SAX, chunk, size, URI):
  1505.     """Create a progressive HTML parser context to build either an
  1506.       event flow if the SAX object is not None, or a DOM tree
  1507.        otherwise. """
  1508.     ret = libxml2mod.htmlCreatePushParser(SAX, chunk, size, URI)
  1509.     if ret is None:raise parserError('htmlCreatePushParser() failed')
  1510.     return parserCtxt(_obj=ret)
  1511.  
  1512. def htmlSAXParseFile(SAX, URI, encoding):
  1513.     """Interface to parse an HTML file or resource pointed by an
  1514.        URI to build an event flow to the SAX object """
  1515.     libxml2mod.htmlSAXParseFile(SAX, URI, encoding)
  1516.  
  1517. def memoryUsed():
  1518.     """Returns the total amount of memory allocated by libxml2 """
  1519.     ret = libxml2mod.xmlMemoryUsed()
  1520.     return ret
  1521.  
  1522. def newNode(name):
  1523.     """Create a new Node """
  1524.     ret = libxml2mod.xmlNewNode(name)
  1525.     if ret is None:raise treeError('xmlNewNode() failed')
  1526.     return xmlNode(_obj=ret)
  1527.  
  1528. def pythonCleanupParser():
  1529.     """Cleanup function for the XML library. It tries to reclaim
  1530.       all parsing related global memory allocated for the library
  1531.       processing. It doesn't deallocate any document related
  1532.       memory. Calling this function should not prevent reusing
  1533.       the library but one should call xmlCleanupParser() only
  1534.       when the process has finished using the library or XML
  1535.        document built with it. """
  1536.     libxml2mod.xmlPythonCleanupParser()
  1537.  
  1538. def setEntityLoader(resolver):
  1539.     """Set the entity resolver as a python function """
  1540.     ret = libxml2mod.xmlSetEntityLoader(resolver)
  1541.     return ret
  1542.  
  1543. #
  1544. # Functions from module relaxng
  1545. #
  1546.  
  1547. def relaxNGCleanupTypes():
  1548.     """Cleanup the default Schemas type library associated to
  1549.        RelaxNG """
  1550.     libxml2mod.xmlRelaxNGCleanupTypes()
  1551.  
  1552. def relaxNGInitTypes():
  1553.     """Initilize the default type libraries. """
  1554.     ret = libxml2mod.xmlRelaxNGInitTypes()
  1555.     return ret
  1556.  
  1557. def relaxNGNewMemParserCtxt(buffer, size):
  1558.     """Create an XML RelaxNGs parse context for that memory buffer
  1559.        expected to contain an XML RelaxNGs file. """
  1560.     ret = libxml2mod.xmlRelaxNGNewMemParserCtxt(buffer, size)
  1561.     if ret is None:raise parserError('xmlRelaxNGNewMemParserCtxt() failed')
  1562.     return relaxNgParserCtxt(_obj=ret)
  1563.  
  1564. def relaxNGNewParserCtxt(URL):
  1565.     """Create an XML RelaxNGs parse context for that file/resource
  1566.        expected to contain an XML RelaxNGs file. """
  1567.     ret = libxml2mod.xmlRelaxNGNewParserCtxt(URL)
  1568.     if ret is None:raise parserError('xmlRelaxNGNewParserCtxt() failed')
  1569.     return relaxNgParserCtxt(_obj=ret)
  1570.  
  1571. #
  1572. # Functions from module tree
  1573. #
  1574.  
  1575. def buildQName(ncname, prefix, memory, len):
  1576.     """Builds the QName @prefix:@ncname in @memory if there is
  1577.       enough space and prefix is not None nor empty, otherwise
  1578.       allocate a new string. If prefix is None or empty it
  1579.        returns ncname. """
  1580.     ret = libxml2mod.xmlBuildQName(ncname, prefix, memory, len)
  1581.     return ret
  1582.  
  1583. def compressMode():
  1584.     """get the default compression mode used, ZLIB based. """
  1585.     ret = libxml2mod.xmlGetCompressMode()
  1586.     return ret
  1587.  
  1588. def isXHTML(systemID, publicID):
  1589.     """Try to find if the document correspond to an XHTML DTD """
  1590.     ret = libxml2mod.xmlIsXHTML(systemID, publicID)
  1591.     return ret
  1592.  
  1593. def newComment(content):
  1594.     """Creation of a new node containing a comment. """
  1595.     ret = libxml2mod.xmlNewComment(content)
  1596.     if ret is None:raise treeError('xmlNewComment() failed')
  1597.     return xmlNode(_obj=ret)
  1598.  
  1599. def newDoc(version):
  1600.     """Creates a new XML document """
  1601.     ret = libxml2mod.xmlNewDoc(version)
  1602.     if ret is None:raise treeError('xmlNewDoc() failed')
  1603.     return xmlDoc(_obj=ret)
  1604.  
  1605. def newPI(name, content):
  1606.     """Creation of a processing instruction element. Use
  1607.        xmlDocNewPI preferably to get string interning """
  1608.     ret = libxml2mod.xmlNewPI(name, content)
  1609.     if ret is None:raise treeError('xmlNewPI() failed')
  1610.     return xmlNode(_obj=ret)
  1611.  
  1612. def newText(content):
  1613.     """Creation of a new text node. """
  1614.     ret = libxml2mod.xmlNewText(content)
  1615.     if ret is None:raise treeError('xmlNewText() failed')
  1616.     return xmlNode(_obj=ret)
  1617.  
  1618. def newTextLen(content, len):
  1619.     """Creation of a new text node with an extra parameter for the
  1620.        content's length """
  1621.     ret = libxml2mod.xmlNewTextLen(content, len)
  1622.     if ret is None:raise treeError('xmlNewTextLen() failed')
  1623.     return xmlNode(_obj=ret)
  1624.  
  1625. def setCompressMode(mode):
  1626.     """set the default compression mode used, ZLIB based Correct
  1627.        values: 0 (uncompressed) to 9 (max compression) """
  1628.     libxml2mod.xmlSetCompressMode(mode)
  1629.  
  1630. def validateNCName(value, space):
  1631.     """Check that a value conforms to the lexical space of NCName """
  1632.     ret = libxml2mod.xmlValidateNCName(value, space)
  1633.     return ret
  1634.  
  1635. def validateNMToken(value, space):
  1636.     """Check that a value conforms to the lexical space of NMToken """
  1637.     ret = libxml2mod.xmlValidateNMToken(value, space)
  1638.     return ret
  1639.  
  1640. def validateName(value, space):
  1641.     """Check that a value conforms to the lexical space of Name """
  1642.     ret = libxml2mod.xmlValidateName(value, space)
  1643.     return ret
  1644.  
  1645. def validateQName(value, space):
  1646.     """Check that a value conforms to the lexical space of QName """
  1647.     ret = libxml2mod.xmlValidateQName(value, space)
  1648.     return ret
  1649.  
  1650. #
  1651. # Functions from module uri
  1652. #
  1653.  
  1654. def URIEscape(str):
  1655.     """Escaping routine, does not do validity checks ! It will try
  1656.       to escape the chars needing this, but this is heuristic
  1657.        based it's impossible to be sure. """
  1658.     ret = libxml2mod.xmlURIEscape(str)
  1659.     return ret
  1660.  
  1661. def URIEscapeStr(str, list):
  1662.     """This routine escapes a string to hex, ignoring reserved
  1663.        characters (a-z) and the characters in the exception list. """
  1664.     ret = libxml2mod.xmlURIEscapeStr(str, list)
  1665.     return ret
  1666.  
  1667. def URIUnescapeString(str, len, target):
  1668.     """Unescaping routine, but does not check that the string is
  1669.       an URI. The output is a direct unsigned char translation of
  1670.       %XX values (no encoding) Note that the length of the result
  1671.        can only be smaller or same size as the input string. """
  1672.     ret = libxml2mod.xmlURIUnescapeString(str, len, target)
  1673.     return ret
  1674.  
  1675. def buildRelativeURI(URI, base):
  1676.     """Expresses the URI of the reference in terms relative to the
  1677.       base.  Some examples of this operation include: base =
  1678.       "http://site1.com/docs/book1.html" URI input               
  1679.       URI returned docs/pic1.gif                    pic1.gif
  1680.       docs/img/pic1.gif                img/pic1.gif img/pic1.gif 
  1681.       ../img/pic1.gif http://site1.com/docs/pic1.gif   pic1.gif
  1682.       http://site2.com/docs/pic1.gif  
  1683.       http://site2.com/docs/pic1.gif  base = "docs/book1.html"
  1684.       URI input                        URI returned docs/pic1.gif
  1685.       pic1.gif docs/img/pic1.gif                img/pic1.gif
  1686.       img/pic1.gif                     ../img/pic1.gif
  1687.       http://site1.com/docs/pic1.gif  
  1688.       http://site1.com/docs/pic1.gif   Note: if the URI reference
  1689.       is really wierd or complicated, it may be worthwhile to
  1690.       first convert it into a "nice" one by calling xmlBuildURI
  1691.       (using 'base') before calling this routine, since this
  1692.       routine (for reasonable efficiency) assumes URI has already
  1693.        been through some validation. """
  1694.     ret = libxml2mod.xmlBuildRelativeURI(URI, base)
  1695.     return ret
  1696.  
  1697. def buildURI(URI, base):
  1698.     """Computes he final URI of the reference done by checking
  1699.       that the given URI is valid, and building the final URI
  1700.       using the base URI. This is processed according to section
  1701.       5.2 of the RFC 2396  5.2. Resolving Relative References to
  1702.        Absolute Form """
  1703.     ret = libxml2mod.xmlBuildURI(URI, base)
  1704.     return ret
  1705.  
  1706. def canonicPath(path):
  1707.     """Constructs a canonic path from the specified path. """
  1708.     ret = libxml2mod.xmlCanonicPath(path)
  1709.     return ret
  1710.  
  1711. def createURI():
  1712.     """Simply creates an empty xmlURI """
  1713.     ret = libxml2mod.xmlCreateURI()
  1714.     if ret is None:raise uriError('xmlCreateURI() failed')
  1715.     return URI(_obj=ret)
  1716.  
  1717. def normalizeURIPath(path):
  1718.     """Applies the 5 normalization steps to a path string--that
  1719.       is, RFC 2396 Section 5.2, steps 6.c through 6.g. 
  1720.       Normalization occurs directly on the string, no new
  1721.        allocation is done """
  1722.     ret = libxml2mod.xmlNormalizeURIPath(path)
  1723.     return ret
  1724.  
  1725. def parseURI(str):
  1726.     """Parse an URI  URI-reference = [ absoluteURI | relativeURI ]
  1727.        [ "#" fragment ] """
  1728.     ret = libxml2mod.xmlParseURI(str)
  1729.     if ret is None:raise uriError('xmlParseURI() failed')
  1730.     return URI(_obj=ret)
  1731.  
  1732. def parseURIRaw(str, raw):
  1733.     """Parse an URI but allows to keep intact the original
  1734.       fragments.  URI-reference = [ absoluteURI | relativeURI ] [
  1735.        "#" fragment ] """
  1736.     ret = libxml2mod.xmlParseURIRaw(str, raw)
  1737.     if ret is None:raise uriError('xmlParseURIRaw() failed')
  1738.     return URI(_obj=ret)
  1739.  
  1740. def pathToURI(path):
  1741.     """Constructs an URI expressing the existing path """
  1742.     ret = libxml2mod.xmlPathToURI(path)
  1743.     return ret
  1744.  
  1745. #
  1746. # Functions from module valid
  1747. #
  1748.  
  1749. def newValidCtxt():
  1750.     """Allocate a validation context structure. """
  1751.     ret = libxml2mod.xmlNewValidCtxt()
  1752.     if ret is None:raise treeError('xmlNewValidCtxt() failed')
  1753.     return ValidCtxt(_obj=ret)
  1754.  
  1755. def validateNameValue(value):
  1756.     """Validate that the given value match Name production """
  1757.     ret = libxml2mod.xmlValidateNameValue(value)
  1758.     return ret
  1759.  
  1760. def validateNamesValue(value):
  1761.     """Validate that the given value match Names production """
  1762.     ret = libxml2mod.xmlValidateNamesValue(value)
  1763.     return ret
  1764.  
  1765. def validateNmtokenValue(value):
  1766.     """Validate that the given value match Nmtoken production  [
  1767.        VC: Name Token ] """
  1768.     ret = libxml2mod.xmlValidateNmtokenValue(value)
  1769.     return ret
  1770.  
  1771. def validateNmtokensValue(value):
  1772.     """Validate that the given value match Nmtokens production  [
  1773.        VC: Name Token ] """
  1774.     ret = libxml2mod.xmlValidateNmtokensValue(value)
  1775.     return ret
  1776.  
  1777. #
  1778. # Functions from module xmlIO
  1779. #
  1780.  
  1781. def checkFilename(path):
  1782.     """function checks to see if @path is a valid source (file,
  1783.       socket...) for XML.  if stat is not available on the target
  1784.        machine, """
  1785.     ret = libxml2mod.xmlCheckFilename(path)
  1786.     return ret
  1787.  
  1788. def cleanupInputCallbacks():
  1789.     """clears the entire input callback table. this includes the
  1790.        compiled-in I/O. """
  1791.     libxml2mod.xmlCleanupInputCallbacks()
  1792.  
  1793. def cleanupOutputCallbacks():
  1794.     """clears the entire output callback table. this includes the
  1795.        compiled-in I/O callbacks. """
  1796.     libxml2mod.xmlCleanupOutputCallbacks()
  1797.  
  1798. def fileMatch(filename):
  1799.     """input from FILE * """
  1800.     ret = libxml2mod.xmlFileMatch(filename)
  1801.     return ret
  1802.  
  1803. def iOFTPMatch(filename):
  1804.     """check if the URI matches an FTP one """
  1805.     ret = libxml2mod.xmlIOFTPMatch(filename)
  1806.     return ret
  1807.  
  1808. def iOHTTPMatch(filename):
  1809.     """check if the URI matches an HTTP one """
  1810.     ret = libxml2mod.xmlIOHTTPMatch(filename)
  1811.     return ret
  1812.  
  1813. def normalizeWindowsPath(path):
  1814.     """This function is obsolete. Please see xmlURIFromPath in
  1815.        uri.c for a better solution. """
  1816.     ret = libxml2mod.xmlNormalizeWindowsPath(path)
  1817.     return ret
  1818.  
  1819. def parserGetDirectory(filename):
  1820.     """lookup the directory for that file """
  1821.     ret = libxml2mod.xmlParserGetDirectory(filename)
  1822.     return ret
  1823.  
  1824. def popInputCallbacks():
  1825.     """Clear the top input callback from the input stack. this
  1826.        includes the compiled-in I/O. """
  1827.     ret = libxml2mod.xmlPopInputCallbacks()
  1828.     return ret
  1829.  
  1830. def registerDefaultInputCallbacks():
  1831.     """Registers the default compiled-in I/O handlers. """
  1832.     libxml2mod.xmlRegisterDefaultInputCallbacks()
  1833.  
  1834. def registerDefaultOutputCallbacks():
  1835.     """Registers the default compiled-in I/O handlers. """
  1836.     libxml2mod.xmlRegisterDefaultOutputCallbacks()
  1837.  
  1838. def registerHTTPPostCallbacks():
  1839.     """By default, libxml submits HTTP output requests using the
  1840.       "PUT" method. Calling this method changes the HTTP output
  1841.        method to use the "POST" method instead. """
  1842.     libxml2mod.xmlRegisterHTTPPostCallbacks()
  1843.  
  1844. #
  1845. # Functions from module xmlerror
  1846. #
  1847.  
  1848. def lastError():
  1849.     """Get the last global error registered. This is per thread if
  1850.        compiled with thread support. """
  1851.     ret = libxml2mod.xmlGetLastError()
  1852.     if ret is None:raise treeError('xmlGetLastError() failed')
  1853.     return Error(_obj=ret)
  1854.  
  1855. def resetLastError():
  1856.     """Cleanup the last global error registered. For parsing error
  1857.        this does not change the well-formedness result. """
  1858.     libxml2mod.xmlResetLastError()
  1859.  
  1860. #
  1861. # Functions from module xmlreader
  1862. #
  1863.  
  1864. def newTextReaderFilename(URI):
  1865.     """Create an xmlTextReader structure fed with the resource at
  1866.        @URI """
  1867.     ret = libxml2mod.xmlNewTextReaderFilename(URI)
  1868.     if ret is None:raise treeError('xmlNewTextReaderFilename() failed')
  1869.     return xmlTextReader(_obj=ret)
  1870.  
  1871. def readerForDoc(cur, URL, encoding, options):
  1872.     """Create an xmltextReader for an XML in-memory document. The
  1873.       parsing flags @options are a combination of xmlParserOption. """
  1874.     ret = libxml2mod.xmlReaderForDoc(cur, URL, encoding, options)
  1875.     if ret is None:raise treeError('xmlReaderForDoc() failed')
  1876.     return xmlTextReader(_obj=ret)
  1877.  
  1878. def readerForFd(fd, URL, encoding, options):
  1879.     """Create an xmltextReader for an XML from a file descriptor.
  1880.       The parsing flags @options are a combination of
  1881.       xmlParserOption. NOTE that the file descriptor will not be
  1882.        closed when the reader is closed or reset. """
  1883.     ret = libxml2mod.xmlReaderForFd(fd, URL, encoding, options)
  1884.     if ret is None:raise treeError('xmlReaderForFd() failed')
  1885.     return xmlTextReader(_obj=ret)
  1886.  
  1887. def readerForFile(filename, encoding, options):
  1888.     """parse an XML file from the filesystem or the network. The
  1889.       parsing flags @options are a combination of xmlParserOption. """
  1890.     ret = libxml2mod.xmlReaderForFile(filename, encoding, options)
  1891.     if ret is None:raise treeError('xmlReaderForFile() failed')
  1892.     return xmlTextReader(_obj=ret)
  1893.  
  1894. def readerForMemory(buffer, size, URL, encoding, options):
  1895.     """Create an xmltextReader for an XML in-memory document. The
  1896.       parsing flags @options are a combination of xmlParserOption. """
  1897.     ret = libxml2mod.xmlReaderForMemory(buffer, size, URL, encoding, options)
  1898.     if ret is None:raise treeError('xmlReaderForMemory() failed')
  1899.     return xmlTextReader(_obj=ret)
  1900.  
  1901. #
  1902. # Functions from module xmlregexp
  1903. #
  1904.  
  1905. def regexpCompile(regexp):
  1906.     """Parses a regular expression conforming to XML Schemas Part
  1907.       2 Datatype Appendix F and builds an automata suitable for
  1908.        testing strings against that regular expression """
  1909.     ret = libxml2mod.xmlRegexpCompile(regexp)
  1910.     if ret is None:raise treeError('xmlRegexpCompile() failed')
  1911.     return xmlReg(_obj=ret)
  1912.  
  1913. #
  1914. # Functions from module xmlschemas
  1915. #
  1916.  
  1917. def schemaNewMemParserCtxt(buffer, size):
  1918.     """Create an XML Schemas parse context for that memory buffer
  1919.        expected to contain an XML Schemas file. """
  1920.     ret = libxml2mod.xmlSchemaNewMemParserCtxt(buffer, size)
  1921.     if ret is None:raise parserError('xmlSchemaNewMemParserCtxt() failed')
  1922.     return SchemaParserCtxt(_obj=ret)
  1923.  
  1924. def schemaNewParserCtxt(URL):
  1925.     """Create an XML Schemas parse context for that file/resource
  1926.        expected to contain an XML Schemas file. """
  1927.     ret = libxml2mod.xmlSchemaNewParserCtxt(URL)
  1928.     if ret is None:raise parserError('xmlSchemaNewParserCtxt() failed')
  1929.     return SchemaParserCtxt(_obj=ret)
  1930.  
  1931. #
  1932. # Functions from module xmlschemastypes
  1933. #
  1934.  
  1935. def schemaCleanupTypes():
  1936.     """Cleanup the default XML Schemas type library """
  1937.     libxml2mod.xmlSchemaCleanupTypes()
  1938.  
  1939. def schemaCollapseString(value):
  1940.     """Removes and normalize white spaces in the string """
  1941.     ret = libxml2mod.xmlSchemaCollapseString(value)
  1942.     return ret
  1943.  
  1944. def schemaInitTypes():
  1945.     """Initialize the default XML Schemas type library """
  1946.     libxml2mod.xmlSchemaInitTypes()
  1947.  
  1948. def schemaWhiteSpaceReplace(value):
  1949.     """Replaces 0xd, 0x9 and 0xa with a space. """
  1950.     ret = libxml2mod.xmlSchemaWhiteSpaceReplace(value)
  1951.     return ret
  1952.  
  1953. #
  1954. # Functions from module xmlstring
  1955. #
  1956.  
  1957. def UTF8Charcmp(utf1, utf2):
  1958.     """compares the two UCS4 values """
  1959.     ret = libxml2mod.xmlUTF8Charcmp(utf1, utf2)
  1960.     return ret
  1961.  
  1962. def UTF8Size(utf):
  1963.     """calculates the internal size of a UTF8 character """
  1964.     ret = libxml2mod.xmlUTF8Size(utf)
  1965.     return ret
  1966.  
  1967. def UTF8Strlen(utf):
  1968.     """compute the length of an UTF8 string, it doesn't do a full
  1969.        UTF8 checking of the content of the string. """
  1970.     ret = libxml2mod.xmlUTF8Strlen(utf)
  1971.     return ret
  1972.  
  1973. def UTF8Strloc(utf, utfchar):
  1974.     """a function to provide the relative location of a UTF8 char """
  1975.     ret = libxml2mod.xmlUTF8Strloc(utf, utfchar)
  1976.     return ret
  1977.  
  1978. def UTF8Strndup(utf, len):
  1979.     """a strndup for array of UTF8's """
  1980.     ret = libxml2mod.xmlUTF8Strndup(utf, len)
  1981.     return ret
  1982.  
  1983. def UTF8Strpos(utf, pos):
  1984.     """a function to provide the equivalent of fetching a
  1985.        character from a string array """
  1986.     ret = libxml2mod.xmlUTF8Strpos(utf, pos)
  1987.     return ret
  1988.  
  1989. def UTF8Strsize(utf, len):
  1990.     """storage size of an UTF8 string the behaviour is not
  1991.        garanteed if the input string is not UTF-8 """
  1992.     ret = libxml2mod.xmlUTF8Strsize(utf, len)
  1993.     return ret
  1994.  
  1995. def UTF8Strsub(utf, start, len):
  1996.     """Create a substring from a given UTF-8 string Note: 
  1997.        positions are given in units of UTF-8 chars """
  1998.     ret = libxml2mod.xmlUTF8Strsub(utf, start, len)
  1999.     return ret
  2000.  
  2001. def checkUTF8(utf):
  2002.     """Checks @utf for being valid UTF-8. @utf is assumed to be
  2003.       null-terminated. This function is not super-strict, as it
  2004.       will allow longer UTF-8 sequences than necessary. Note that
  2005.       Java is capable of producing these sequences if provoked.
  2006.       Also note, this routine checks for the 4-byte maximum size,
  2007.        but does not check for 0x10ffff maximum value. """
  2008.     ret = libxml2mod.xmlCheckUTF8(utf)
  2009.     return ret
  2010.  
  2011. #
  2012. # Functions from module xmlunicode
  2013. #
  2014.  
  2015. def uCSIsAegeanNumbers(code):
  2016.     """Check whether the character is part of AegeanNumbers UCS
  2017.        Block """
  2018.     ret = libxml2mod.xmlUCSIsAegeanNumbers(code)
  2019.     return ret
  2020.  
  2021. def uCSIsAlphabeticPresentationForms(code):
  2022.     """Check whether the character is part of
  2023.        AlphabeticPresentationForms UCS Block """
  2024.     ret = libxml2mod.xmlUCSIsAlphabeticPresentationForms(code)
  2025.     return ret
  2026.  
  2027. def uCSIsArabic(code):
  2028.     """Check whether the character is part of Arabic UCS Block """
  2029.     ret = libxml2mod.xmlUCSIsArabic(code)
  2030.     return ret
  2031.  
  2032. def uCSIsArabicPresentationFormsA(code):
  2033.     """Check whether the character is part of
  2034.        ArabicPresentationForms-A UCS Block """
  2035.     ret = libxml2mod.xmlUCSIsArabicPresentationFormsA(code)
  2036.     return ret
  2037.  
  2038. def uCSIsArabicPresentationFormsB(code):
  2039.     """Check whether the character is part of
  2040.        ArabicPresentationForms-B UCS Block """
  2041.     ret = libxml2mod.xmlUCSIsArabicPresentationFormsB(code)
  2042.     return ret
  2043.  
  2044. def uCSIsArmenian(code):
  2045.     """Check whether the character is part of Armenian UCS Block """
  2046.     ret = libxml2mod.xmlUCSIsArmenian(code)
  2047.     return ret
  2048.  
  2049. def uCSIsArrows(code):
  2050.     """Check whether the character is part of Arrows UCS Block """
  2051.     ret = libxml2mod.xmlUCSIsArrows(code)
  2052.     return ret
  2053.  
  2054. def uCSIsBasicLatin(code):
  2055.     """Check whether the character is part of BasicLatin UCS Block """
  2056.     ret = libxml2mod.xmlUCSIsBasicLatin(code)
  2057.     return ret
  2058.  
  2059. def uCSIsBengali(code):
  2060.     """Check whether the character is part of Bengali UCS Block """
  2061.     ret = libxml2mod.xmlUCSIsBengali(code)
  2062.     return ret
  2063.  
  2064. def uCSIsBlock(code, block):
  2065.     """Check whether the character is part of the UCS Block """
  2066.     ret = libxml2mod.xmlUCSIsBlock(code, block)
  2067.     return ret
  2068.  
  2069. def uCSIsBlockElements(code):
  2070.     """Check whether the character is part of BlockElements UCS
  2071.        Block """
  2072.     ret = libxml2mod.xmlUCSIsBlockElements(code)
  2073.     return ret
  2074.  
  2075. def uCSIsBopomofo(code):
  2076.     """Check whether the character is part of Bopomofo UCS Block """
  2077.     ret = libxml2mod.xmlUCSIsBopomofo(code)
  2078.     return ret
  2079.  
  2080. def uCSIsBopomofoExtended(code):
  2081.     """Check whether the character is part of BopomofoExtended UCS
  2082.        Block """
  2083.     ret = libxml2mod.xmlUCSIsBopomofoExtended(code)
  2084.     return ret
  2085.  
  2086. def uCSIsBoxDrawing(code):
  2087.     """Check whether the character is part of BoxDrawing UCS Block """
  2088.     ret = libxml2mod.xmlUCSIsBoxDrawing(code)
  2089.     return ret
  2090.  
  2091. def uCSIsBraillePatterns(code):
  2092.     """Check whether the character is part of BraillePatterns UCS
  2093.        Block """
  2094.     ret = libxml2mod.xmlUCSIsBraillePatterns(code)
  2095.     return ret
  2096.  
  2097. def uCSIsBuhid(code):
  2098.     """Check whether the character is part of Buhid UCS Block """
  2099.     ret = libxml2mod.xmlUCSIsBuhid(code)
  2100.     return ret
  2101.  
  2102. def uCSIsByzantineMusicalSymbols(code):
  2103.     """Check whether the character is part of
  2104.        ByzantineMusicalSymbols UCS Block """
  2105.     ret = libxml2mod.xmlUCSIsByzantineMusicalSymbols(code)
  2106.     return ret
  2107.  
  2108. def uCSIsCJKCompatibility(code):
  2109.     """Check whether the character is part of CJKCompatibility UCS
  2110.        Block """
  2111.     ret = libxml2mod.xmlUCSIsCJKCompatibility(code)
  2112.     return ret
  2113.  
  2114. def uCSIsCJKCompatibilityForms(code):
  2115.     """Check whether the character is part of
  2116.        CJKCompatibilityForms UCS Block """
  2117.     ret = libxml2mod.xmlUCSIsCJKCompatibilityForms(code)
  2118.     return ret
  2119.  
  2120. def uCSIsCJKCompatibilityIdeographs(code):
  2121.     """Check whether the character is part of
  2122.        CJKCompatibilityIdeographs UCS Block """
  2123.     ret = libxml2mod.xmlUCSIsCJKCompatibilityIdeographs(code)
  2124.     return ret
  2125.  
  2126. def uCSIsCJKCompatibilityIdeographsSupplement(code):
  2127.     """Check whether the character is part of
  2128.        CJKCompatibilityIdeographsSupplement UCS Block """
  2129.     ret = libxml2mod.xmlUCSIsCJKCompatibilityIdeographsSupplement(code)
  2130.     return ret
  2131.  
  2132. def uCSIsCJKRadicalsSupplement(code):
  2133.     """Check whether the character is part of
  2134.        CJKRadicalsSupplement UCS Block """
  2135.     ret = libxml2mod.xmlUCSIsCJKRadicalsSupplement(code)
  2136.     return ret
  2137.  
  2138. def uCSIsCJKSymbolsandPunctuation(code):
  2139.     """Check whether the character is part of
  2140.        CJKSymbolsandPunctuation UCS Block """
  2141.     ret = libxml2mod.xmlUCSIsCJKSymbolsandPunctuation(code)
  2142.     return ret
  2143.  
  2144. def uCSIsCJKUnifiedIdeographs(code):
  2145.     """Check whether the character is part of CJKUnifiedIdeographs
  2146.        UCS Block """
  2147.     ret = libxml2mod.xmlUCSIsCJKUnifiedIdeographs(code)
  2148.     return ret
  2149.  
  2150. def uCSIsCJKUnifiedIdeographsExtensionA(code):
  2151.     """Check whether the character is part of
  2152.        CJKUnifiedIdeographsExtensionA UCS Block """
  2153.     ret = libxml2mod.xmlUCSIsCJKUnifiedIdeographsExtensionA(code)
  2154.     return ret
  2155.  
  2156. def uCSIsCJKUnifiedIdeographsExtensionB(code):
  2157.     """Check whether the character is part of
  2158.        CJKUnifiedIdeographsExtensionB UCS Block """
  2159.     ret = libxml2mod.xmlUCSIsCJKUnifiedIdeographsExtensionB(code)
  2160.     return ret
  2161.  
  2162. def uCSIsCat(code, cat):
  2163.     """Check whether the character is part of the UCS Category """
  2164.     ret = libxml2mod.xmlUCSIsCat(code, cat)
  2165.     return ret
  2166.  
  2167. def uCSIsCatC(code):
  2168.     """Check whether the character is part of C UCS Category """
  2169.     ret = libxml2mod.xmlUCSIsCatC(code)
  2170.     return ret
  2171.  
  2172. def uCSIsCatCc(code):
  2173.     """Check whether the character is part of Cc UCS Category """
  2174.     ret = libxml2mod.xmlUCSIsCatCc(code)
  2175.     return ret
  2176.  
  2177. def uCSIsCatCf(code):
  2178.     """Check whether the character is part of Cf UCS Category """
  2179.     ret = libxml2mod.xmlUCSIsCatCf(code)
  2180.     return ret
  2181.  
  2182. def uCSIsCatCo(code):
  2183.     """Check whether the character is part of Co UCS Category """
  2184.     ret = libxml2mod.xmlUCSIsCatCo(code)
  2185.     return ret
  2186.  
  2187. def uCSIsCatCs(code):
  2188.     """Check whether the character is part of Cs UCS Category """
  2189.     ret = libxml2mod.xmlUCSIsCatCs(code)
  2190.     return ret
  2191.  
  2192. def uCSIsCatL(code):
  2193.     """Check whether the character is part of L UCS Category """
  2194.     ret = libxml2mod.xmlUCSIsCatL(code)
  2195.     return ret
  2196.  
  2197. def uCSIsCatLl(code):
  2198.     """Check whether the character is part of Ll UCS Category """
  2199.     ret = libxml2mod.xmlUCSIsCatLl(code)
  2200.     return ret
  2201.  
  2202. def uCSIsCatLm(code):
  2203.     """Check whether the character is part of Lm UCS Category """
  2204.     ret = libxml2mod.xmlUCSIsCatLm(code)
  2205.     return ret
  2206.  
  2207. def uCSIsCatLo(code):
  2208.     """Check whether the character is part of Lo UCS Category """
  2209.     ret = libxml2mod.xmlUCSIsCatLo(code)
  2210.     return ret
  2211.  
  2212. def uCSIsCatLt(code):
  2213.     """Check whether the character is part of Lt UCS Category """
  2214.     ret = libxml2mod.xmlUCSIsCatLt(code)
  2215.     return ret
  2216.  
  2217. def uCSIsCatLu(code):
  2218.     """Check whether the character is part of Lu UCS Category """
  2219.     ret = libxml2mod.xmlUCSIsCatLu(code)
  2220.     return ret
  2221.  
  2222. def uCSIsCatM(code):
  2223.     """Check whether the character is part of M UCS Category """
  2224.     ret = libxml2mod.xmlUCSIsCatM(code)
  2225.     return ret
  2226.  
  2227. def uCSIsCatMc(code):
  2228.     """Check whether the character is part of Mc UCS Category """
  2229.     ret = libxml2mod.xmlUCSIsCatMc(code)
  2230.     return ret
  2231.  
  2232. def uCSIsCatMe(code):
  2233.     """Check whether the character is part of Me UCS Category """
  2234.     ret = libxml2mod.xmlUCSIsCatMe(code)
  2235.     return ret
  2236.  
  2237. def uCSIsCatMn(code):
  2238.     """Check whether the character is part of Mn UCS Category """
  2239.     ret = libxml2mod.xmlUCSIsCatMn(code)
  2240.     return ret
  2241.  
  2242. def uCSIsCatN(code):
  2243.     """Check whether the character is part of N UCS Category """
  2244.     ret = libxml2mod.xmlUCSIsCatN(code)
  2245.     return ret
  2246.  
  2247. def uCSIsCatNd(code):
  2248.     """Check whether the character is part of Nd UCS Category """
  2249.     ret = libxml2mod.xmlUCSIsCatNd(code)
  2250.     return ret
  2251.  
  2252. def uCSIsCatNl(code):
  2253.     """Check whether the character is part of Nl UCS Category """
  2254.     ret = libxml2mod.xmlUCSIsCatNl(code)
  2255.     return ret
  2256.  
  2257. def uCSIsCatNo(code):
  2258.     """Check whether the character is part of No UCS Category """
  2259.     ret = libxml2mod.xmlUCSIsCatNo(code)
  2260.     return ret
  2261.  
  2262. def uCSIsCatP(code):
  2263.     """Check whether the character is part of P UCS Category """
  2264.     ret = libxml2mod.xmlUCSIsCatP(code)
  2265.     return ret
  2266.  
  2267. def uCSIsCatPc(code):
  2268.     """Check whether the character is part of Pc UCS Category """
  2269.     ret = libxml2mod.xmlUCSIsCatPc(code)
  2270.     return ret
  2271.  
  2272. def uCSIsCatPd(code):
  2273.     """Check whether the character is part of Pd UCS Category """
  2274.     ret = libxml2mod.xmlUCSIsCatPd(code)
  2275.     return ret
  2276.  
  2277. def uCSIsCatPe(code):
  2278.     """Check whether the character is part of Pe UCS Category """
  2279.     ret = libxml2mod.xmlUCSIsCatPe(code)
  2280.     return ret
  2281.  
  2282. def uCSIsCatPf(code):
  2283.     """Check whether the character is part of Pf UCS Category """
  2284.     ret = libxml2mod.xmlUCSIsCatPf(code)
  2285.     return ret
  2286.  
  2287. def uCSIsCatPi(code):
  2288.     """Check whether the character is part of Pi UCS Category """
  2289.     ret = libxml2mod.xmlUCSIsCatPi(code)
  2290.     return ret
  2291.  
  2292. def uCSIsCatPo(code):
  2293.     """Check whether the character is part of Po UCS Category """
  2294.     ret = libxml2mod.xmlUCSIsCatPo(code)
  2295.     return ret
  2296.  
  2297. def uCSIsCatPs(code):
  2298.     """Check whether the character is part of Ps UCS Category """
  2299.     ret = libxml2mod.xmlUCSIsCatPs(code)
  2300.     return ret
  2301.  
  2302. def uCSIsCatS(code):
  2303.     """Check whether the character is part of S UCS Category """
  2304.     ret = libxml2mod.xmlUCSIsCatS(code)
  2305.     return ret
  2306.  
  2307. def uCSIsCatSc(code):
  2308.     """Check whether the character is part of Sc UCS Category """
  2309.     ret = libxml2mod.xmlUCSIsCatSc(code)
  2310.     return ret
  2311.  
  2312. def uCSIsCatSk(code):
  2313.     """Check whether the character is part of Sk UCS Category """
  2314.     ret = libxml2mod.xmlUCSIsCatSk(code)
  2315.     return ret
  2316.  
  2317. def uCSIsCatSm(code):
  2318.     """Check whether the character is part of Sm UCS Category """
  2319.     ret = libxml2mod.xmlUCSIsCatSm(code)
  2320.     return ret
  2321.  
  2322. def uCSIsCatSo(code):
  2323.     """Check whether the character is part of So UCS Category """
  2324.     ret = libxml2mod.xmlUCSIsCatSo(code)
  2325.     return ret
  2326.  
  2327. def uCSIsCatZ(code):
  2328.     """Check whether the character is part of Z UCS Category """
  2329.     ret = libxml2mod.xmlUCSIsCatZ(code)
  2330.     return ret
  2331.  
  2332. def uCSIsCatZl(code):
  2333.     """Check whether the character is part of Zl UCS Category """
  2334.     ret = libxml2mod.xmlUCSIsCatZl(code)
  2335.     return ret
  2336.  
  2337. def uCSIsCatZp(code):
  2338.     """Check whether the character is part of Zp UCS Category """
  2339.     ret = libxml2mod.xmlUCSIsCatZp(code)
  2340.     return ret
  2341.  
  2342. def uCSIsCatZs(code):
  2343.     """Check whether the character is part of Zs UCS Category """
  2344.     ret = libxml2mod.xmlUCSIsCatZs(code)
  2345.     return ret
  2346.  
  2347. def uCSIsCherokee(code):
  2348.     """Check whether the character is part of Cherokee UCS Block """
  2349.     ret = libxml2mod.xmlUCSIsCherokee(code)
  2350.     return ret
  2351.  
  2352. def uCSIsCombiningDiacriticalMarks(code):
  2353.     """Check whether the character is part of
  2354.        CombiningDiacriticalMarks UCS Block """
  2355.     ret = libxml2mod.xmlUCSIsCombiningDiacriticalMarks(code)
  2356.     return ret
  2357.  
  2358. def uCSIsCombiningDiacriticalMarksforSymbols(code):
  2359.     """Check whether the character is part of
  2360.        CombiningDiacriticalMarksforSymbols UCS Block """
  2361.     ret = libxml2mod.xmlUCSIsCombiningDiacriticalMarksforSymbols(code)
  2362.     return ret
  2363.  
  2364. def uCSIsCombiningHalfMarks(code):
  2365.     """Check whether the character is part of CombiningHalfMarks
  2366.        UCS Block """
  2367.     ret = libxml2mod.xmlUCSIsCombiningHalfMarks(code)
  2368.     return ret
  2369.  
  2370. def uCSIsCombiningMarksforSymbols(code):
  2371.     """Check whether the character is part of
  2372.        CombiningMarksforSymbols UCS Block """
  2373.     ret = libxml2mod.xmlUCSIsCombiningMarksforSymbols(code)
  2374.     return ret
  2375.  
  2376. def uCSIsControlPictures(code):
  2377.     """Check whether the character is part of ControlPictures UCS
  2378.        Block """
  2379.     ret = libxml2mod.xmlUCSIsControlPictures(code)
  2380.     return ret
  2381.  
  2382. def uCSIsCurrencySymbols(code):
  2383.     """Check whether the character is part of CurrencySymbols UCS
  2384.        Block """
  2385.     ret = libxml2mod.xmlUCSIsCurrencySymbols(code)
  2386.     return ret
  2387.  
  2388. def uCSIsCypriotSyllabary(code):
  2389.     """Check whether the character is part of CypriotSyllabary UCS
  2390.        Block """
  2391.     ret = libxml2mod.xmlUCSIsCypriotSyllabary(code)
  2392.     return ret
  2393.  
  2394. def uCSIsCyrillic(code):
  2395.     """Check whether the character is part of Cyrillic UCS Block """
  2396.     ret = libxml2mod.xmlUCSIsCyrillic(code)
  2397.     return ret
  2398.  
  2399. def uCSIsCyrillicSupplement(code):
  2400.     """Check whether the character is part of CyrillicSupplement
  2401.        UCS Block """
  2402.     ret = libxml2mod.xmlUCSIsCyrillicSupplement(code)
  2403.     return ret
  2404.  
  2405. def uCSIsDeseret(code):
  2406.     """Check whether the character is part of Deseret UCS Block """
  2407.     ret = libxml2mod.xmlUCSIsDeseret(code)
  2408.     return ret
  2409.  
  2410. def uCSIsDevanagari(code):
  2411.     """Check whether the character is part of Devanagari UCS Block """
  2412.     ret = libxml2mod.xmlUCSIsDevanagari(code)
  2413.     return ret
  2414.  
  2415. def uCSIsDingbats(code):
  2416.     """Check whether the character is part of Dingbats UCS Block """
  2417.     ret = libxml2mod.xmlUCSIsDingbats(code)
  2418.     return ret
  2419.  
  2420. def uCSIsEnclosedAlphanumerics(code):
  2421.     """Check whether the character is part of
  2422.        EnclosedAlphanumerics UCS Block """
  2423.     ret = libxml2mod.xmlUCSIsEnclosedAlphanumerics(code)
  2424.     return ret
  2425.  
  2426. def uCSIsEnclosedCJKLettersandMonths(code):
  2427.     """Check whether the character is part of
  2428.        EnclosedCJKLettersandMonths UCS Block """
  2429.     ret = libxml2mod.xmlUCSIsEnclosedCJKLettersandMonths(code)
  2430.     return ret
  2431.  
  2432. def uCSIsEthiopic(code):
  2433.     """Check whether the character is part of Ethiopic UCS Block """
  2434.     ret = libxml2mod.xmlUCSIsEthiopic(code)
  2435.     return ret
  2436.  
  2437. def uCSIsGeneralPunctuation(code):
  2438.     """Check whether the character is part of GeneralPunctuation
  2439.        UCS Block """
  2440.     ret = libxml2mod.xmlUCSIsGeneralPunctuation(code)
  2441.     return ret
  2442.  
  2443. def uCSIsGeometricShapes(code):
  2444.     """Check whether the character is part of GeometricShapes UCS
  2445.        Block """
  2446.     ret = libxml2mod.xmlUCSIsGeometricShapes(code)
  2447.     return ret
  2448.  
  2449. def uCSIsGeorgian(code):
  2450.     """Check whether the character is part of Georgian UCS Block """
  2451.     ret = libxml2mod.xmlUCSIsGeorgian(code)
  2452.     return ret
  2453.  
  2454. def uCSIsGothic(code):
  2455.     """Check whether the character is part of Gothic UCS Block """
  2456.     ret = libxml2mod.xmlUCSIsGothic(code)
  2457.     return ret
  2458.  
  2459. def uCSIsGreek(code):
  2460.     """Check whether the character is part of Greek UCS Block """
  2461.     ret = libxml2mod.xmlUCSIsGreek(code)
  2462.     return ret
  2463.  
  2464. def uCSIsGreekExtended(code):
  2465.     """Check whether the character is part of GreekExtended UCS
  2466.        Block """
  2467.     ret = libxml2mod.xmlUCSIsGreekExtended(code)
  2468.     return ret
  2469.  
  2470. def uCSIsGreekandCoptic(code):
  2471.     """Check whether the character is part of GreekandCoptic UCS
  2472.        Block """
  2473.     ret = libxml2mod.xmlUCSIsGreekandCoptic(code)
  2474.     return ret
  2475.  
  2476. def uCSIsGujarati(code):
  2477.     """Check whether the character is part of Gujarati UCS Block """
  2478.     ret = libxml2mod.xmlUCSIsGujarati(code)
  2479.     return ret
  2480.  
  2481. def uCSIsGurmukhi(code):
  2482.     """Check whether the character is part of Gurmukhi UCS Block """
  2483.     ret = libxml2mod.xmlUCSIsGurmukhi(code)
  2484.     return ret
  2485.  
  2486. def uCSIsHalfwidthandFullwidthForms(code):
  2487.     """Check whether the character is part of
  2488.        HalfwidthandFullwidthForms UCS Block """
  2489.     ret = libxml2mod.xmlUCSIsHalfwidthandFullwidthForms(code)
  2490.     return ret
  2491.  
  2492. def uCSIsHangulCompatibilityJamo(code):
  2493.     """Check whether the character is part of
  2494.        HangulCompatibilityJamo UCS Block """
  2495.     ret = libxml2mod.xmlUCSIsHangulCompatibilityJamo(code)
  2496.     return ret
  2497.  
  2498. def uCSIsHangulJamo(code):
  2499.     """Check whether the character is part of HangulJamo UCS Block """
  2500.     ret = libxml2mod.xmlUCSIsHangulJamo(code)
  2501.     return ret
  2502.  
  2503. def uCSIsHangulSyllables(code):
  2504.     """Check whether the character is part of HangulSyllables UCS
  2505.        Block """
  2506.     ret = libxml2mod.xmlUCSIsHangulSyllables(code)
  2507.     return ret
  2508.  
  2509. def uCSIsHanunoo(code):
  2510.     """Check whether the character is part of Hanunoo UCS Block """
  2511.     ret = libxml2mod.xmlUCSIsHanunoo(code)
  2512.     return ret
  2513.  
  2514. def uCSIsHebrew(code):
  2515.     """Check whether the character is part of Hebrew UCS Block """
  2516.     ret = libxml2mod.xmlUCSIsHebrew(code)
  2517.     return ret
  2518.  
  2519. def uCSIsHighPrivateUseSurrogates(code):
  2520.     """Check whether the character is part of
  2521.        HighPrivateUseSurrogates UCS Block """
  2522.     ret = libxml2mod.xmlUCSIsHighPrivateUseSurrogates(code)
  2523.     return ret
  2524.  
  2525. def uCSIsHighSurrogates(code):
  2526.     """Check whether the character is part of HighSurrogates UCS
  2527.        Block """
  2528.     ret = libxml2mod.xmlUCSIsHighSurrogates(code)
  2529.     return ret
  2530.  
  2531. def uCSIsHiragana(code):
  2532.     """Check whether the character is part of Hiragana UCS Block """
  2533.     ret = libxml2mod.xmlUCSIsHiragana(code)
  2534.     return ret
  2535.  
  2536. def uCSIsIPAExtensions(code):
  2537.     """Check whether the character is part of IPAExtensions UCS
  2538.        Block """
  2539.     ret = libxml2mod.xmlUCSIsIPAExtensions(code)
  2540.     return ret
  2541.  
  2542. def uCSIsIdeographicDescriptionCharacters(code):
  2543.     """Check whether the character is part of
  2544.        IdeographicDescriptionCharacters UCS Block """
  2545.     ret = libxml2mod.xmlUCSIsIdeographicDescriptionCharacters(code)
  2546.     return ret
  2547.  
  2548. def uCSIsKanbun(code):
  2549.     """Check whether the character is part of Kanbun UCS Block """
  2550.     ret = libxml2mod.xmlUCSIsKanbun(code)
  2551.     return ret
  2552.  
  2553. def uCSIsKangxiRadicals(code):
  2554.     """Check whether the character is part of KangxiRadicals UCS
  2555.        Block """
  2556.     ret = libxml2mod.xmlUCSIsKangxiRadicals(code)
  2557.     return ret
  2558.  
  2559. def uCSIsKannada(code):
  2560.     """Check whether the character is part of Kannada UCS Block """
  2561.     ret = libxml2mod.xmlUCSIsKannada(code)
  2562.     return ret
  2563.  
  2564. def uCSIsKatakana(code):
  2565.     """Check whether the character is part of Katakana UCS Block """
  2566.     ret = libxml2mod.xmlUCSIsKatakana(code)
  2567.     return ret
  2568.  
  2569. def uCSIsKatakanaPhoneticExtensions(code):
  2570.     """Check whether the character is part of
  2571.        KatakanaPhoneticExtensions UCS Block """
  2572.     ret = libxml2mod.xmlUCSIsKatakanaPhoneticExtensions(code)
  2573.     return ret
  2574.  
  2575. def uCSIsKhmer(code):
  2576.     """Check whether the character is part of Khmer UCS Block """
  2577.     ret = libxml2mod.xmlUCSIsKhmer(code)
  2578.     return ret
  2579.  
  2580. def uCSIsKhmerSymbols(code):
  2581.     """Check whether the character is part of KhmerSymbols UCS
  2582.        Block """
  2583.     ret = libxml2mod.xmlUCSIsKhmerSymbols(code)
  2584.     return ret
  2585.  
  2586. def uCSIsLao(code):
  2587.     """Check whether the character is part of Lao UCS Block """
  2588.     ret = libxml2mod.xmlUCSIsLao(code)
  2589.     return ret
  2590.  
  2591. def uCSIsLatin1Supplement(code):
  2592.     """Check whether the character is part of Latin-1Supplement
  2593.        UCS Block """
  2594.     ret = libxml2mod.xmlUCSIsLatin1Supplement(code)
  2595.     return ret
  2596.  
  2597. def uCSIsLatinExtendedA(code):
  2598.     """Check whether the character is part of LatinExtended-A UCS
  2599.        Block """
  2600.     ret = libxml2mod.xmlUCSIsLatinExtendedA(code)
  2601.     return ret
  2602.  
  2603. def uCSIsLatinExtendedAdditional(code):
  2604.     """Check whether the character is part of
  2605.        LatinExtendedAdditional UCS Block """
  2606.     ret = libxml2mod.xmlUCSIsLatinExtendedAdditional(code)
  2607.     return ret
  2608.  
  2609. def uCSIsLatinExtendedB(code):
  2610.     """Check whether the character is part of LatinExtended-B UCS
  2611.        Block """
  2612.     ret = libxml2mod.xmlUCSIsLatinExtendedB(code)
  2613.     return ret
  2614.  
  2615. def uCSIsLetterlikeSymbols(code):
  2616.     """Check whether the character is part of LetterlikeSymbols
  2617.        UCS Block """
  2618.     ret = libxml2mod.xmlUCSIsLetterlikeSymbols(code)
  2619.     return ret
  2620.  
  2621. def uCSIsLimbu(code):
  2622.     """Check whether the character is part of Limbu UCS Block """
  2623.     ret = libxml2mod.xmlUCSIsLimbu(code)
  2624.     return ret
  2625.  
  2626. def uCSIsLinearBIdeograms(code):
  2627.     """Check whether the character is part of LinearBIdeograms UCS
  2628.        Block """
  2629.     ret = libxml2mod.xmlUCSIsLinearBIdeograms(code)
  2630.     return ret
  2631.  
  2632. def uCSIsLinearBSyllabary(code):
  2633.     """Check whether the character is part of LinearBSyllabary UCS
  2634.        Block """
  2635.     ret = libxml2mod.xmlUCSIsLinearBSyllabary(code)
  2636.     return ret
  2637.  
  2638. def uCSIsLowSurrogates(code):
  2639.     """Check whether the character is part of LowSurrogates UCS
  2640.        Block """
  2641.     ret = libxml2mod.xmlUCSIsLowSurrogates(code)
  2642.     return ret
  2643.  
  2644. def uCSIsMalayalam(code):
  2645.     """Check whether the character is part of Malayalam UCS Block """
  2646.     ret = libxml2mod.xmlUCSIsMalayalam(code)
  2647.     return ret
  2648.  
  2649. def uCSIsMathematicalAlphanumericSymbols(code):
  2650.     """Check whether the character is part of
  2651.        MathematicalAlphanumericSymbols UCS Block """
  2652.     ret = libxml2mod.xmlUCSIsMathematicalAlphanumericSymbols(code)
  2653.     return ret
  2654.  
  2655. def uCSIsMathematicalOperators(code):
  2656.     """Check whether the character is part of
  2657.        MathematicalOperators UCS Block """
  2658.     ret = libxml2mod.xmlUCSIsMathematicalOperators(code)
  2659.     return ret
  2660.  
  2661. def uCSIsMiscellaneousMathematicalSymbolsA(code):
  2662.     """Check whether the character is part of
  2663.        MiscellaneousMathematicalSymbols-A UCS Block """
  2664.     ret = libxml2mod.xmlUCSIsMiscellaneousMathematicalSymbolsA(code)
  2665.     return ret
  2666.  
  2667. def uCSIsMiscellaneousMathematicalSymbolsB(code):
  2668.     """Check whether the character is part of
  2669.        MiscellaneousMathematicalSymbols-B UCS Block """
  2670.     ret = libxml2mod.xmlUCSIsMiscellaneousMathematicalSymbolsB(code)
  2671.     return ret
  2672.  
  2673. def uCSIsMiscellaneousSymbols(code):
  2674.     """Check whether the character is part of MiscellaneousSymbols
  2675.        UCS Block """
  2676.     ret = libxml2mod.xmlUCSIsMiscellaneousSymbols(code)
  2677.     return ret
  2678.  
  2679. def uCSIsMiscellaneousSymbolsandArrows(code):
  2680.     """Check whether the character is part of
  2681.        MiscellaneousSymbolsandArrows UCS Block """
  2682.     ret = libxml2mod.xmlUCSIsMiscellaneousSymbolsandArrows(code)
  2683.     return ret
  2684.  
  2685. def uCSIsMiscellaneousTechnical(code):
  2686.     """Check whether the character is part of
  2687.        MiscellaneousTechnical UCS Block """
  2688.     ret = libxml2mod.xmlUCSIsMiscellaneousTechnical(code)
  2689.     return ret
  2690.  
  2691. def uCSIsMongolian(code):
  2692.     """Check whether the character is part of Mongolian UCS Block """
  2693.     ret = libxml2mod.xmlUCSIsMongolian(code)
  2694.     return ret
  2695.  
  2696. def uCSIsMusicalSymbols(code):
  2697.     """Check whether the character is part of MusicalSymbols UCS
  2698.        Block """
  2699.     ret = libxml2mod.xmlUCSIsMusicalSymbols(code)
  2700.     return ret
  2701.  
  2702. def uCSIsMyanmar(code):
  2703.     """Check whether the character is part of Myanmar UCS Block """
  2704.     ret = libxml2mod.xmlUCSIsMyanmar(code)
  2705.     return ret
  2706.  
  2707. def uCSIsNumberForms(code):
  2708.     """Check whether the character is part of NumberForms UCS Block """
  2709.     ret = libxml2mod.xmlUCSIsNumberForms(code)
  2710.     return ret
  2711.  
  2712. def uCSIsOgham(code):
  2713.     """Check whether the character is part of Ogham UCS Block """
  2714.     ret = libxml2mod.xmlUCSIsOgham(code)
  2715.     return ret
  2716.  
  2717. def uCSIsOldItalic(code):
  2718.     """Check whether the character is part of OldItalic UCS Block """
  2719.     ret = libxml2mod.xmlUCSIsOldItalic(code)
  2720.     return ret
  2721.  
  2722. def uCSIsOpticalCharacterRecognition(code):
  2723.     """Check whether the character is part of
  2724.        OpticalCharacterRecognition UCS Block """
  2725.     ret = libxml2mod.xmlUCSIsOpticalCharacterRecognition(code)
  2726.     return ret
  2727.  
  2728. def uCSIsOriya(code):
  2729.     """Check whether the character is part of Oriya UCS Block """
  2730.     ret = libxml2mod.xmlUCSIsOriya(code)
  2731.     return ret
  2732.  
  2733. def uCSIsOsmanya(code):
  2734.     """Check whether the character is part of Osmanya UCS Block """
  2735.     ret = libxml2mod.xmlUCSIsOsmanya(code)
  2736.     return ret
  2737.  
  2738. def uCSIsPhoneticExtensions(code):
  2739.     """Check whether the character is part of PhoneticExtensions
  2740.        UCS Block """
  2741.     ret = libxml2mod.xmlUCSIsPhoneticExtensions(code)
  2742.     return ret
  2743.  
  2744. def uCSIsPrivateUse(code):
  2745.     """Check whether the character is part of PrivateUse UCS Block """
  2746.     ret = libxml2mod.xmlUCSIsPrivateUse(code)
  2747.     return ret
  2748.  
  2749. def uCSIsPrivateUseArea(code):
  2750.     """Check whether the character is part of PrivateUseArea UCS
  2751.        Block """
  2752.     ret = libxml2mod.xmlUCSIsPrivateUseArea(code)
  2753.     return ret
  2754.  
  2755. def uCSIsRunic(code):
  2756.     """Check whether the character is part of Runic UCS Block """
  2757.     ret = libxml2mod.xmlUCSIsRunic(code)
  2758.     return ret
  2759.  
  2760. def uCSIsShavian(code):
  2761.     """Check whether the character is part of Shavian UCS Block """
  2762.     ret = libxml2mod.xmlUCSIsShavian(code)
  2763.     return ret
  2764.  
  2765. def uCSIsSinhala(code):
  2766.     """Check whether the character is part of Sinhala UCS Block """
  2767.     ret = libxml2mod.xmlUCSIsSinhala(code)
  2768.     return ret
  2769.  
  2770. def uCSIsSmallFormVariants(code):
  2771.     """Check whether the character is part of SmallFormVariants
  2772.        UCS Block """
  2773.     ret = libxml2mod.xmlUCSIsSmallFormVariants(code)
  2774.     return ret
  2775.  
  2776. def uCSIsSpacingModifierLetters(code):
  2777.     """Check whether the character is part of
  2778.        SpacingModifierLetters UCS Block """
  2779.     ret = libxml2mod.xmlUCSIsSpacingModifierLetters(code)
  2780.     return ret
  2781.  
  2782. def uCSIsSpecials(code):
  2783.     """Check whether the character is part of Specials UCS Block """
  2784.     ret = libxml2mod.xmlUCSIsSpecials(code)
  2785.     return ret
  2786.  
  2787. def uCSIsSuperscriptsandSubscripts(code):
  2788.     """Check whether the character is part of
  2789.        SuperscriptsandSubscripts UCS Block """
  2790.     ret = libxml2mod.xmlUCSIsSuperscriptsandSubscripts(code)
  2791.     return ret
  2792.  
  2793. def uCSIsSupplementalArrowsA(code):
  2794.     """Check whether the character is part of SupplementalArrows-A
  2795.        UCS Block """
  2796.     ret = libxml2mod.xmlUCSIsSupplementalArrowsA(code)
  2797.     return ret
  2798.  
  2799. def uCSIsSupplementalArrowsB(code):
  2800.     """Check whether the character is part of SupplementalArrows-B
  2801.        UCS Block """
  2802.     ret = libxml2mod.xmlUCSIsSupplementalArrowsB(code)
  2803.     return ret
  2804.  
  2805. def uCSIsSupplementalMathematicalOperators(code):
  2806.     """Check whether the character is part of
  2807.        SupplementalMathematicalOperators UCS Block """
  2808.     ret = libxml2mod.xmlUCSIsSupplementalMathematicalOperators(code)
  2809.     return ret
  2810.  
  2811. def uCSIsSupplementaryPrivateUseAreaA(code):
  2812.     """Check whether the character is part of
  2813.        SupplementaryPrivateUseArea-A UCS Block """
  2814.     ret = libxml2mod.xmlUCSIsSupplementaryPrivateUseAreaA(code)
  2815.     return ret
  2816.  
  2817. def uCSIsSupplementaryPrivateUseAreaB(code):
  2818.     """Check whether the character is part of
  2819.        SupplementaryPrivateUseArea-B UCS Block """
  2820.     ret = libxml2mod.xmlUCSIsSupplementaryPrivateUseAreaB(code)
  2821.     return ret
  2822.  
  2823. def uCSIsSyriac(code):
  2824.     """Check whether the character is part of Syriac UCS Block """
  2825.     ret = libxml2mod.xmlUCSIsSyriac(code)
  2826.     return ret
  2827.  
  2828. def uCSIsTagalog(code):
  2829.     """Check whether the character is part of Tagalog UCS Block """
  2830.     ret = libxml2mod.xmlUCSIsTagalog(code)
  2831.     return ret
  2832.  
  2833. def uCSIsTagbanwa(code):
  2834.     """Check whether the character is part of Tagbanwa UCS Block """
  2835.     ret = libxml2mod.xmlUCSIsTagbanwa(code)
  2836.     return ret
  2837.  
  2838. def uCSIsTags(code):
  2839.     """Check whether the character is part of Tags UCS Block """
  2840.     ret = libxml2mod.xmlUCSIsTags(code)
  2841.     return ret
  2842.  
  2843. def uCSIsTaiLe(code):
  2844.     """Check whether the character is part of TaiLe UCS Block """
  2845.     ret = libxml2mod.xmlUCSIsTaiLe(code)
  2846.     return ret
  2847.  
  2848. def uCSIsTaiXuanJingSymbols(code):
  2849.     """Check whether the character is part of TaiXuanJingSymbols
  2850.        UCS Block """
  2851.     ret = libxml2mod.xmlUCSIsTaiXuanJingSymbols(code)
  2852.     return ret
  2853.  
  2854. def uCSIsTamil(code):
  2855.     """Check whether the character is part of Tamil UCS Block """
  2856.     ret = libxml2mod.xmlUCSIsTamil(code)
  2857.     return ret
  2858.  
  2859. def uCSIsTelugu(code):
  2860.     """Check whether the character is part of Telugu UCS Block """
  2861.     ret = libxml2mod.xmlUCSIsTelugu(code)
  2862.     return ret
  2863.  
  2864. def uCSIsThaana(code):
  2865.     """Check whether the character is part of Thaana UCS Block """
  2866.     ret = libxml2mod.xmlUCSIsThaana(code)
  2867.     return ret
  2868.  
  2869. def uCSIsThai(code):
  2870.     """Check whether the character is part of Thai UCS Block """
  2871.     ret = libxml2mod.xmlUCSIsThai(code)
  2872.     return ret
  2873.  
  2874. def uCSIsTibetan(code):
  2875.     """Check whether the character is part of Tibetan UCS Block """
  2876.     ret = libxml2mod.xmlUCSIsTibetan(code)
  2877.     return ret
  2878.  
  2879. def uCSIsUgaritic(code):
  2880.     """Check whether the character is part of Ugaritic UCS Block """
  2881.     ret = libxml2mod.xmlUCSIsUgaritic(code)
  2882.     return ret
  2883.  
  2884. def uCSIsUnifiedCanadianAboriginalSyllabics(code):
  2885.     """Check whether the character is part of
  2886.        UnifiedCanadianAboriginalSyllabics UCS Block """
  2887.     ret = libxml2mod.xmlUCSIsUnifiedCanadianAboriginalSyllabics(code)
  2888.     return ret
  2889.  
  2890. def uCSIsVariationSelectors(code):
  2891.     """Check whether the character is part of VariationSelectors
  2892.        UCS Block """
  2893.     ret = libxml2mod.xmlUCSIsVariationSelectors(code)
  2894.     return ret
  2895.  
  2896. def uCSIsVariationSelectorsSupplement(code):
  2897.     """Check whether the character is part of
  2898.        VariationSelectorsSupplement UCS Block """
  2899.     ret = libxml2mod.xmlUCSIsVariationSelectorsSupplement(code)
  2900.     return ret
  2901.  
  2902. def uCSIsYiRadicals(code):
  2903.     """Check whether the character is part of YiRadicals UCS Block """
  2904.     ret = libxml2mod.xmlUCSIsYiRadicals(code)
  2905.     return ret
  2906.  
  2907. def uCSIsYiSyllables(code):
  2908.     """Check whether the character is part of YiSyllables UCS Block """
  2909.     ret = libxml2mod.xmlUCSIsYiSyllables(code)
  2910.     return ret
  2911.  
  2912. def uCSIsYijingHexagramSymbols(code):
  2913.     """Check whether the character is part of
  2914.        YijingHexagramSymbols UCS Block """
  2915.     ret = libxml2mod.xmlUCSIsYijingHexagramSymbols(code)
  2916.     return ret
  2917.  
  2918. #
  2919. # Functions from module xmlversion
  2920. #
  2921.  
  2922. def checkVersion(version):
  2923.     """check the compiled lib version against the include one.
  2924.        This can warn or immediately kill the application """
  2925.     libxml2mod.xmlCheckVersion(version)
  2926.  
  2927. #
  2928. # Functions from module xpathInternals
  2929. #
  2930.  
  2931. def valuePop(ctxt):
  2932.     """Pops the top XPath object from the value stack """
  2933.     if ctxt is None: ctxt__o = None
  2934.     else: ctxt__o = ctxt._o
  2935.     ret = libxml2mod.valuePop(ctxt__o)
  2936.     return ret
  2937.  
  2938. class xmlNode(xmlCore):
  2939.     def __init__(self, _obj=None):
  2940.         if type(_obj).__name__ != 'PyCObject':
  2941.             raise TypeError, 'xmlNode needs a PyCObject argument'
  2942.         self._o = _obj
  2943.         xmlCore.__init__(self, _obj=_obj)
  2944.  
  2945.     def __repr__(self):
  2946.         return "<xmlNode (%s) object at 0x%x>" % (self.name, long(pos_id (self)))
  2947.  
  2948.     # accessors for xmlNode
  2949.     def ns(self):
  2950.         """Get the namespace of a node """
  2951.         ret = libxml2mod.xmlNodeGetNs(self._o)
  2952.         if ret is None:return None
  2953.         __tmp = xmlNs(_obj=ret)
  2954.         return __tmp
  2955.  
  2956.     def nsDefs(self):
  2957.         """Get the namespace of a node """
  2958.         ret = libxml2mod.xmlNodeGetNsDefs(self._o)
  2959.         if ret is None:return None
  2960.         __tmp = xmlNs(_obj=ret)
  2961.         return __tmp
  2962.  
  2963.     #
  2964.     # xmlNode functions from module debugXML
  2965.     #
  2966.  
  2967.     def debugDumpNode(self, output, depth):
  2968.         """Dumps debug information for the element node, it is
  2969.            recursive """
  2970.         libxml2mod.xmlDebugDumpNode(output, self._o, depth)
  2971.  
  2972.     def debugDumpNodeList(self, output, depth):
  2973.         """Dumps debug information for the list of element node, it is
  2974.            recursive """
  2975.         libxml2mod.xmlDebugDumpNodeList(output, self._o, depth)
  2976.  
  2977.     def debugDumpOneNode(self, output, depth):
  2978.         """Dumps debug information for the element node, it is not
  2979.            recursive """
  2980.         libxml2mod.xmlDebugDumpOneNode(output, self._o, depth)
  2981.  
  2982.     def lsCountNode(self):
  2983.         """Count the children of @node. """
  2984.         ret = libxml2mod.xmlLsCountNode(self._o)
  2985.         return ret
  2986.  
  2987.     def lsOneNode(self, output):
  2988.         """Dump to @output the type and name of @node. """
  2989.         libxml2mod.xmlLsOneNode(output, self._o)
  2990.  
  2991.     def shellPrintNode(self):
  2992.         """Print node to the output FILE """
  2993.         libxml2mod.xmlShellPrintNode(self._o)
  2994.  
  2995.     #
  2996.     # xmlNode functions from module tree
  2997.     #
  2998.  
  2999.     def addChild(self, cur):
  3000.         """Add a new node to @parent, at the end of the child (or
  3001.           property) list merging adjacent TEXT nodes (in which case
  3002.           @cur is freed) If the new node is ATTRIBUTE, it is added
  3003.           into properties instead of children. If there is an
  3004.            attribute with equal name, it is first destroyed. """
  3005.         if cur is None: cur__o = None
  3006.         else: cur__o = cur._o
  3007.         ret = libxml2mod.xmlAddChild(self._o, cur__o)
  3008.         if ret is None:raise treeError('xmlAddChild() failed')
  3009.         __tmp = xmlNode(_obj=ret)
  3010.         return __tmp
  3011.  
  3012.     def addChildList(self, cur):
  3013.         """Add a list of node at the end of the child list of the
  3014.            parent merging adjacent TEXT nodes (@cur may be freed) """
  3015.         if cur is None: cur__o = None
  3016.         else: cur__o = cur._o
  3017.         ret = libxml2mod.xmlAddChildList(self._o, cur__o)
  3018.         if ret is None:raise treeError('xmlAddChildList() failed')
  3019.         __tmp = xmlNode(_obj=ret)
  3020.         return __tmp
  3021.  
  3022.     def addContent(self, content):
  3023.         """Append the extra substring to the node content. NOTE: In
  3024.           contrast to xmlNodeSetContent(), @content is supposed to be
  3025.           raw text, so unescaped XML special chars are allowed,
  3026.            entity references are not supported. """
  3027.         libxml2mod.xmlNodeAddContent(self._o, content)
  3028.  
  3029.     def addContentLen(self, content, len):
  3030.         """Append the extra substring to the node content. NOTE: In
  3031.           contrast to xmlNodeSetContentLen(), @content is supposed to
  3032.           be raw text, so unescaped XML special chars are allowed,
  3033.            entity references are not supported. """
  3034.         libxml2mod.xmlNodeAddContentLen(self._o, content, len)
  3035.  
  3036.     def addNextSibling(self, elem):
  3037.         """Add a new node @elem as the next sibling of @cur If the new
  3038.           node was already inserted in a document it is first
  3039.           unlinked from its existing context. As a result of text
  3040.           merging @elem may be freed. If the new node is ATTRIBUTE,
  3041.           it is added into properties instead of children. If there
  3042.            is an attribute with equal name, it is first destroyed. """
  3043.         if elem is None: elem__o = None
  3044.         else: elem__o = elem._o
  3045.         ret = libxml2mod.xmlAddNextSibling(self._o, elem__o)
  3046.         if ret is None:raise treeError('xmlAddNextSibling() failed')
  3047.         __tmp = xmlNode(_obj=ret)
  3048.         return __tmp
  3049.  
  3050.     def addPrevSibling(self, elem):
  3051.         """Add a new node @elem as the previous sibling of @cur
  3052.           merging adjacent TEXT nodes (@elem may be freed) If the new
  3053.           node was already inserted in a document it is first
  3054.           unlinked from its existing context. If the new node is
  3055.           ATTRIBUTE, it is added into properties instead of children.
  3056.           If there is an attribute with equal name, it is first
  3057.            destroyed. """
  3058.         if elem is None: elem__o = None
  3059.         else: elem__o = elem._o
  3060.         ret = libxml2mod.xmlAddPrevSibling(self._o, elem__o)
  3061.         if ret is None:raise treeError('xmlAddPrevSibling() failed')
  3062.         __tmp = xmlNode(_obj=ret)
  3063.         return __tmp
  3064.  
  3065.     def addSibling(self, elem):
  3066.         """Add a new element @elem to the list of siblings of @cur
  3067.           merging adjacent TEXT nodes (@elem may be freed) If the new
  3068.           element was already inserted in a document it is first
  3069.            unlinked from its existing context. """
  3070.         if elem is None: elem__o = None
  3071.         else: elem__o = elem._o
  3072.         ret = libxml2mod.xmlAddSibling(self._o, elem__o)
  3073.         if ret is None:raise treeError('xmlAddSibling() failed')
  3074.         __tmp = xmlNode(_obj=ret)
  3075.         return __tmp
  3076.  
  3077.     def copyNode(self, extended):
  3078.         """Do a copy of the node. """
  3079.         ret = libxml2mod.xmlCopyNode(self._o, extended)
  3080.         if ret is None:raise treeError('xmlCopyNode() failed')
  3081.         __tmp = xmlNode(_obj=ret)
  3082.         return __tmp
  3083.  
  3084.     def copyNodeList(self):
  3085.         """Do a recursive copy of the node list. Use
  3086.           xmlDocCopyNodeList() if possible to ensure string interning. """
  3087.         ret = libxml2mod.xmlCopyNodeList(self._o)
  3088.         if ret is None:raise treeError('xmlCopyNodeList() failed')
  3089.         __tmp = xmlNode(_obj=ret)
  3090.         return __tmp
  3091.  
  3092.     def copyProp(self, cur):
  3093.         """Do a copy of the attribute. """
  3094.         if cur is None: cur__o = None
  3095.         else: cur__o = cur._o
  3096.         ret = libxml2mod.xmlCopyProp(self._o, cur__o)
  3097.         if ret is None:raise treeError('xmlCopyProp() failed')
  3098.         __tmp = xmlAttr(_obj=ret)
  3099.         return __tmp
  3100.  
  3101.     def copyPropList(self, cur):
  3102.         """Do a copy of an attribute list. """
  3103.         if cur is None: cur__o = None
  3104.         else: cur__o = cur._o
  3105.         ret = libxml2mod.xmlCopyPropList(self._o, cur__o)
  3106.         if ret is None:raise treeError('xmlCopyPropList() failed')
  3107.         __tmp = xmlAttr(_obj=ret)
  3108.         return __tmp
  3109.  
  3110.     def docCopyNode(self, doc, extended):
  3111.         """Do a copy of the node to a given document. """
  3112.         if doc is None: doc__o = None
  3113.         else: doc__o = doc._o
  3114.         ret = libxml2mod.xmlDocCopyNode(self._o, doc__o, extended)
  3115.         if ret is None:raise treeError('xmlDocCopyNode() failed')
  3116.         __tmp = xmlNode(_obj=ret)
  3117.         return __tmp
  3118.  
  3119.     def docCopyNodeList(self, doc):
  3120.         """Do a recursive copy of the node list. """
  3121.         if doc is None: doc__o = None
  3122.         else: doc__o = doc._o
  3123.         ret = libxml2mod.xmlDocCopyNodeList(doc__o, self._o)
  3124.         if ret is None:raise treeError('xmlDocCopyNodeList() failed')
  3125.         __tmp = xmlNode(_obj=ret)
  3126.         return __tmp
  3127.  
  3128.     def docSetRootElement(self, doc):
  3129.         """Set the root element of the document (doc->children is a
  3130.            list containing possibly comments, PIs, etc ...). """
  3131.         if doc is None: doc__o = None
  3132.         else: doc__o = doc._o
  3133.         ret = libxml2mod.xmlDocSetRootElement(doc__o, self._o)
  3134.         if ret is None:return None
  3135.         __tmp = xmlNode(_obj=ret)
  3136.         return __tmp
  3137.  
  3138.     def freeNode(self):
  3139.         """Free a node, this is a recursive behaviour, all the
  3140.           children are freed too. This doesn't unlink the child from
  3141.            the list, use xmlUnlinkNode() first. """
  3142.         libxml2mod.xmlFreeNode(self._o)
  3143.  
  3144.     def freeNodeList(self):
  3145.         """Free a node and all its siblings, this is a recursive
  3146.            behaviour, all the children are freed too. """
  3147.         libxml2mod.xmlFreeNodeList(self._o)
  3148.  
  3149.     def getBase(self, doc):
  3150.         """Searches for the BASE URL. The code should work on both XML
  3151.           and HTML document even if base mechanisms are completely
  3152.           different. It returns the base as defined in RFC 2396
  3153.           sections 5.1.1. Base URI within Document Content and 5.1.2.
  3154.           Base URI from the Encapsulating Entity However it does not
  3155.           return the document base (5.1.3), use xmlDocumentGetBase()
  3156.            for this """
  3157.         if doc is None: doc__o = None
  3158.         else: doc__o = doc._o
  3159.         ret = libxml2mod.xmlNodeGetBase(doc__o, self._o)
  3160.         return ret
  3161.  
  3162.     def getContent(self):
  3163.         """Read the value of a node, this can be either the text
  3164.           carried directly by this node if it's a TEXT node or the
  3165.           aggregate string of the values carried by this node child's
  3166.            (TEXT and ENTITY_REF). Entity references are substituted. """
  3167.         ret = libxml2mod.xmlNodeGetContent(self._o)
  3168.         return ret
  3169.  
  3170.     def getLang(self):
  3171.         """Searches the language of a node, i.e. the values of the
  3172.           xml:lang attribute or the one carried by the nearest
  3173.            ancestor. """
  3174.         ret = libxml2mod.xmlNodeGetLang(self._o)
  3175.         return ret
  3176.  
  3177.     def getSpacePreserve(self):
  3178.         """Searches the space preserving behaviour of a node, i.e. the
  3179.           values of the xml:space attribute or the one carried by the
  3180.            nearest ancestor. """
  3181.         ret = libxml2mod.xmlNodeGetSpacePreserve(self._o)
  3182.         return ret
  3183.  
  3184.     def hasNsProp(self, name, nameSpace):
  3185.         """Search for an attribute associated to a node This attribute
  3186.           has to be anchored in the namespace specified. This does
  3187.           the entity substitution. This function looks in DTD
  3188.           attribute declaration for #FIXED or default declaration
  3189.           values unless DTD use has been turned off. Note that a
  3190.            namespace of None indicates to use the default namespace. """
  3191.         ret = libxml2mod.xmlHasNsProp(self._o, name, nameSpace)
  3192.         if ret is None:return None
  3193.         __tmp = xmlAttr(_obj=ret)
  3194.         return __tmp
  3195.  
  3196.     def hasProp(self, name):
  3197.         """Search an attribute associated to a node This function also
  3198.           looks in DTD attribute declaration for #FIXED or default
  3199.            declaration values unless DTD use has been turned off. """
  3200.         ret = libxml2mod.xmlHasProp(self._o, name)
  3201.         if ret is None:return None
  3202.         __tmp = xmlAttr(_obj=ret)
  3203.         return __tmp
  3204.  
  3205.     def isBlankNode(self):
  3206.         """Checks whether this node is an empty or whitespace only
  3207.            (and possibly ignorable) text-node. """
  3208.         ret = libxml2mod.xmlIsBlankNode(self._o)
  3209.         return ret
  3210.  
  3211.     def isText(self):
  3212.         """Is this node a Text node ? """
  3213.         ret = libxml2mod.xmlNodeIsText(self._o)
  3214.         return ret
  3215.  
  3216.     def lastChild(self):
  3217.         """Search the last child of a node. """
  3218.         ret = libxml2mod.xmlGetLastChild(self._o)
  3219.         if ret is None:raise treeError('xmlGetLastChild() failed')
  3220.         __tmp = xmlNode(_obj=ret)
  3221.         return __tmp
  3222.  
  3223.     def lineNo(self):
  3224.         """Get line number of @node. This requires activation of this
  3225.           option before invoking the parser by calling
  3226.            xmlLineNumbersDefault(1) """
  3227.         ret = libxml2mod.xmlGetLineNo(self._o)
  3228.         return ret
  3229.  
  3230.     def listGetRawString(self, doc, inLine):
  3231.         """Builds the string equivalent to the text contained in the
  3232.           Node list made of TEXTs and ENTITY_REFs, contrary to
  3233.           xmlNodeListGetString() this function doesn't do any
  3234.            character encoding handling. """
  3235.         if doc is None: doc__o = None
  3236.         else: doc__o = doc._o
  3237.         ret = libxml2mod.xmlNodeListGetRawString(doc__o, self._o, inLine)
  3238.         return ret
  3239.  
  3240.     def listGetString(self, doc, inLine):
  3241.         """Build the string equivalent to the text contained in the
  3242.            Node list made of TEXTs and ENTITY_REFs """
  3243.         if doc is None: doc__o = None
  3244.         else: doc__o = doc._o
  3245.         ret = libxml2mod.xmlNodeListGetString(doc__o, self._o, inLine)
  3246.         return ret
  3247.  
  3248.     def newChild(self, ns, name, content):
  3249.         """Creation of a new child element, added at the end of
  3250.           @parent children list. @ns and @content parameters are
  3251.           optional (None). If @ns is None, the newly created element
  3252.           inherits the namespace of @parent. If @content is non None,
  3253.           a child list containing the TEXTs and ENTITY_REFs node will
  3254.           be created. NOTE: @content is supposed to be a piece of XML
  3255.           CDATA, so it allows entity references. XML special chars
  3256.           must be escaped first by using
  3257.           xmlEncodeEntitiesReentrant(), or xmlNewTextChild() should
  3258.            be used. """
  3259.         if ns is None: ns__o = None
  3260.         else: ns__o = ns._o
  3261.         ret = libxml2mod.xmlNewChild(self._o, ns__o, name, content)
  3262.         if ret is None:raise treeError('xmlNewChild() failed')
  3263.         __tmp = xmlNode(_obj=ret)
  3264.         return __tmp
  3265.  
  3266.     def newNs(self, href, prefix):
  3267.         """Creation of a new Namespace. This function will refuse to
  3268.           create a namespace with a similar prefix than an existing
  3269.           one present on this node. We use href==None in the case of
  3270.            an element creation where the namespace was not defined. """
  3271.         ret = libxml2mod.xmlNewNs(self._o, href, prefix)
  3272.         if ret is None:raise treeError('xmlNewNs() failed')
  3273.         __tmp = xmlNs(_obj=ret)
  3274.         return __tmp
  3275.  
  3276.     def newNsProp(self, ns, name, value):
  3277.         """Create a new property tagged with a namespace and carried
  3278.            by a node. """
  3279.         if ns is None: ns__o = None
  3280.         else: ns__o = ns._o
  3281.         ret = libxml2mod.xmlNewNsProp(self._o, ns__o, name, value)
  3282.         if ret is None:raise treeError('xmlNewNsProp() failed')
  3283.         __tmp = xmlAttr(_obj=ret)
  3284.         return __tmp
  3285.  
  3286.     def newNsPropEatName(self, ns, name, value):
  3287.         """Create a new property tagged with a namespace and carried
  3288.            by a node. """
  3289.         if ns is None: ns__o = None
  3290.         else: ns__o = ns._o
  3291.         ret = libxml2mod.xmlNewNsPropEatName(self._o, ns__o, name, value)
  3292.         if ret is None:raise treeError('xmlNewNsPropEatName() failed')
  3293.         __tmp = xmlAttr(_obj=ret)
  3294.         return __tmp
  3295.  
  3296.     def newProp(self, name, value):
  3297.         """Create a new property carried by a node. """
  3298.         ret = libxml2mod.xmlNewProp(self._o, name, value)
  3299.         if ret is None:raise treeError('xmlNewProp() failed')
  3300.         __tmp = xmlAttr(_obj=ret)
  3301.         return __tmp
  3302.  
  3303.     def newTextChild(self, ns, name, content):
  3304.         """Creation of a new child element, added at the end of
  3305.           @parent children list. @ns and @content parameters are
  3306.           optional (None). If @ns is None, the newly created element
  3307.           inherits the namespace of @parent. If @content is non None,
  3308.           a child TEXT node will be created containing the string
  3309.           @content. NOTE: Use xmlNewChild() if @content will contain
  3310.           entities that need to be preserved. Use this function,
  3311.           xmlNewTextChild(), if you need to ensure that reserved XML
  3312.           chars that might appear in @content, such as the ampersand,
  3313.           greater-than or less-than signs, are automatically replaced
  3314.            by their XML escaped entity representations. """
  3315.         if ns is None: ns__o = None
  3316.         else: ns__o = ns._o
  3317.         ret = libxml2mod.xmlNewTextChild(self._o, ns__o, name, content)
  3318.         if ret is None:raise treeError('xmlNewTextChild() failed')
  3319.         __tmp = xmlNode(_obj=ret)
  3320.         return __tmp
  3321.  
  3322.     def noNsProp(self, name):
  3323.         """Search and get the value of an attribute associated to a
  3324.           node This does the entity substitution. This function looks
  3325.           in DTD attribute declaration for #FIXED or default
  3326.           declaration values unless DTD use has been turned off. This
  3327.           function is similar to xmlGetProp except it will accept
  3328.            only an attribute in no namespace. """
  3329.         ret = libxml2mod.xmlGetNoNsProp(self._o, name)
  3330.         return ret
  3331.  
  3332.     def nodePath(self):
  3333.         """Build a structure based Path for the given node """
  3334.         ret = libxml2mod.xmlGetNodePath(self._o)
  3335.         return ret
  3336.  
  3337.     def nsProp(self, name, nameSpace):
  3338.         """Search and get the value of an attribute associated to a
  3339.           node This attribute has to be anchored in the namespace
  3340.           specified. This does the entity substitution. This function
  3341.           looks in DTD attribute declaration for #FIXED or default
  3342.            declaration values unless DTD use has been turned off. """
  3343.         ret = libxml2mod.xmlGetNsProp(self._o, name, nameSpace)
  3344.         return ret
  3345.  
  3346.     def prop(self, name):
  3347.         """Search and get the value of an attribute associated to a
  3348.           node This does the entity substitution. This function looks
  3349.           in DTD attribute declaration for #FIXED or default
  3350.           declaration values unless DTD use has been turned off.
  3351.           NOTE: this function acts independently of namespaces
  3352.           associated to the attribute. Use xmlGetNsProp() or
  3353.            xmlGetNoNsProp() for namespace aware processing. """
  3354.         ret = libxml2mod.xmlGetProp(self._o, name)
  3355.         return ret
  3356.  
  3357.     def reconciliateNs(self, doc):
  3358.         """This function checks that all the namespaces declared
  3359.           within the given tree are properly declared. This is needed
  3360.           for example after Copy or Cut and then paste operations.
  3361.           The subtree may still hold pointers to namespace
  3362.           declarations outside the subtree or invalid/masked. As much
  3363.           as possible the function try to reuse the existing
  3364.           namespaces found in the new environment. If not possible
  3365.           the new namespaces are redeclared on @tree at the top of
  3366.            the given subtree. """
  3367.         if doc is None: doc__o = None
  3368.         else: doc__o = doc._o
  3369.         ret = libxml2mod.xmlReconciliateNs(doc__o, self._o)
  3370.         return ret
  3371.  
  3372.     def replaceNode(self, cur):
  3373.         """Unlink the old node from its current context, prune the new
  3374.           one at the same place. If @cur was already inserted in a
  3375.            document it is first unlinked from its existing context. """
  3376.         if cur is None: cur__o = None
  3377.         else: cur__o = cur._o
  3378.         ret = libxml2mod.xmlReplaceNode(self._o, cur__o)
  3379.         if ret is None:raise treeError('xmlReplaceNode() failed')
  3380.         __tmp = xmlNode(_obj=ret)
  3381.         return __tmp
  3382.  
  3383.     def searchNs(self, doc, nameSpace):
  3384.         """Search a Ns registered under a given name space for a
  3385.           document. recurse on the parents until it finds the defined
  3386.           namespace or return None otherwise. @nameSpace can be None,
  3387.           this is a search for the default namespace. We don't allow
  3388.           to cross entities boundaries. If you don't declare the
  3389.           namespace within those you will be in troubles !!! A
  3390.            warning is generated to cover this case. """
  3391.         if doc is None: doc__o = None
  3392.         else: doc__o = doc._o
  3393.         ret = libxml2mod.xmlSearchNs(doc__o, self._o, nameSpace)
  3394.         if ret is None:raise treeError('xmlSearchNs() failed')
  3395.         __tmp = xmlNs(_obj=ret)
  3396.         return __tmp
  3397.  
  3398.     def searchNsByHref(self, doc, href):
  3399.         """Search a Ns aliasing a given URI. Recurse on the parents
  3400.           until it finds the defined namespace or return None
  3401.            otherwise. """
  3402.         if doc is None: doc__o = None
  3403.         else: doc__o = doc._o
  3404.         ret = libxml2mod.xmlSearchNsByHref(doc__o, self._o, href)
  3405.         if ret is None:raise treeError('xmlSearchNsByHref() failed')
  3406.         __tmp = xmlNs(_obj=ret)
  3407.         return __tmp
  3408.  
  3409.     def setBase(self, uri):
  3410.         """Set (or reset) the base URI of a node, i.e. the value of
  3411.            the xml:base attribute. """
  3412.         libxml2mod.xmlNodeSetBase(self._o, uri)
  3413.  
  3414.     def setContent(self, content):
  3415.         """Replace the content of a node. NOTE: @content is supposed
  3416.           to be a piece of XML CDATA, so it allows entity references,
  3417.           but XML special chars need to be escaped first by using
  3418.            xmlEncodeEntitiesReentrant() resp. xmlEncodeSpecialChars(). """
  3419.         libxml2mod.xmlNodeSetContent(self._o, content)
  3420.  
  3421.     def setContentLen(self, content, len):
  3422.         """Replace the content of a node. NOTE: @content is supposed
  3423.           to be a piece of XML CDATA, so it allows entity references,
  3424.           but XML special chars need to be escaped first by using
  3425.            xmlEncodeEntitiesReentrant() resp. xmlEncodeSpecialChars(). """
  3426.         libxml2mod.xmlNodeSetContentLen(self._o, content, len)
  3427.  
  3428.     def setLang(self, lang):
  3429.         """Set the language of a node, i.e. the values of the xml:lang
  3430.            attribute. """
  3431.         libxml2mod.xmlNodeSetLang(self._o, lang)
  3432.  
  3433.     def setListDoc(self, doc):
  3434.         """update all nodes in the list to point to the right document """
  3435.         if doc is None: doc__o = None
  3436.         else: doc__o = doc._o
  3437.         libxml2mod.xmlSetListDoc(self._o, doc__o)
  3438.  
  3439.     def setName(self, name):
  3440.         """Set (or reset) the name of a node. """
  3441.         libxml2mod.xmlNodeSetName(self._o, name)
  3442.  
  3443.     def setNs(self, ns):
  3444.         """Associate a namespace to a node, a posteriori. """
  3445.         if ns is None: ns__o = None
  3446.         else: ns__o = ns._o
  3447.         libxml2mod.xmlSetNs(self._o, ns__o)
  3448.  
  3449.     def setNsProp(self, ns, name, value):
  3450.         """Set (or reset) an attribute carried by a node. The ns
  3451.            structure must be in scope, this is not checked """
  3452.         if ns is None: ns__o = None
  3453.         else: ns__o = ns._o
  3454.         ret = libxml2mod.xmlSetNsProp(self._o, ns__o, name, value)
  3455.         if ret is None:raise treeError('xmlSetNsProp() failed')
  3456.         __tmp = xmlAttr(_obj=ret)
  3457.         return __tmp
  3458.  
  3459.     def setProp(self, name, value):
  3460.         """Set (or reset) an attribute carried by a node. If @name has
  3461.           a prefix, then the corresponding namespace-binding will be
  3462.           used, if in scope; it is an error it there's no such
  3463.            ns-binding for the prefix in scope. """
  3464.         ret = libxml2mod.xmlSetProp(self._o, name, value)
  3465.         if ret is None:raise treeError('xmlSetProp() failed')
  3466.         __tmp = xmlAttr(_obj=ret)
  3467.         return __tmp
  3468.  
  3469.     def setSpacePreserve(self, val):
  3470.         """Set (or reset) the space preserving behaviour of a node,
  3471.            i.e. the value of the xml:space attribute. """
  3472.         libxml2mod.xmlNodeSetSpacePreserve(self._o, val)
  3473.  
  3474.     def setTreeDoc(self, doc):
  3475.         """update all nodes under the tree to point to the right
  3476.            document """
  3477.         if doc is None: doc__o = None
  3478.         else: doc__o = doc._o
  3479.         libxml2mod.xmlSetTreeDoc(self._o, doc__o)
  3480.  
  3481.     def textConcat(self, content, len):
  3482.         """Concat the given string at the end of the existing node
  3483.            content """
  3484.         ret = libxml2mod.xmlTextConcat(self._o, content, len)
  3485.         return ret
  3486.  
  3487.     def textMerge(self, second):
  3488.         """Merge two text nodes into one """
  3489.         if second is None: second__o = None
  3490.         else: second__o = second._o
  3491.         ret = libxml2mod.xmlTextMerge(self._o, second__o)
  3492.         if ret is None:raise treeError('xmlTextMerge() failed')
  3493.         __tmp = xmlNode(_obj=ret)
  3494.         return __tmp
  3495.  
  3496.     def unlinkNode(self):
  3497.         """Unlink a node from it's current context, the node is not
  3498.            freed """
  3499.         libxml2mod.xmlUnlinkNode(self._o)
  3500.  
  3501.     def unsetNsProp(self, ns, name):
  3502.         """Remove an attribute carried by a node. """
  3503.         if ns is None: ns__o = None
  3504.         else: ns__o = ns._o
  3505.         ret = libxml2mod.xmlUnsetNsProp(self._o, ns__o, name)
  3506.         return ret
  3507.  
  3508.     def unsetProp(self, name):
  3509.         """Remove an attribute carried by a node. This handles only
  3510.            attributes in no namespace. """
  3511.         ret = libxml2mod.xmlUnsetProp(self._o, name)
  3512.         return ret
  3513.  
  3514.     #
  3515.     # xmlNode functions from module valid
  3516.     #
  3517.  
  3518.     def isID(self, doc, attr):
  3519.         """Determine whether an attribute is of type ID. In case we
  3520.           have DTD(s) then this is done if DTD loading has been
  3521.           requested. In the case of HTML documents parsed with the
  3522.            HTML parser, then ID detection is done systematically. """
  3523.         if doc is None: doc__o = None
  3524.         else: doc__o = doc._o
  3525.         if attr is None: attr__o = None
  3526.         else: attr__o = attr._o
  3527.         ret = libxml2mod.xmlIsID(doc__o, self._o, attr__o)
  3528.         return ret
  3529.  
  3530.     def isRef(self, doc, attr):
  3531.         """Determine whether an attribute is of type Ref. In case we
  3532.           have DTD(s) then this is simple, otherwise we use an
  3533.            heuristic: name Ref (upper or lowercase). """
  3534.         if doc is None: doc__o = None
  3535.         else: doc__o = doc._o
  3536.         if attr is None: attr__o = None
  3537.         else: attr__o = attr._o
  3538.         ret = libxml2mod.xmlIsRef(doc__o, self._o, attr__o)
  3539.         return ret
  3540.  
  3541.     def validNormalizeAttributeValue(self, doc, name, value):
  3542.         """Does the validation related extra step of the normalization
  3543.           of attribute values:  If the declared value is not CDATA,
  3544.           then the XML processor must further process the normalized
  3545.           attribute value by discarding any leading and trailing
  3546.           space (#x20) characters, and by replacing sequences of
  3547.            space (#x20) characters by single space (#x20) character. """
  3548.         if doc is None: doc__o = None
  3549.         else: doc__o = doc._o
  3550.         ret = libxml2mod.xmlValidNormalizeAttributeValue(doc__o, self._o, name, value)
  3551.         return ret
  3552.  
  3553.     #
  3554.     # xmlNode functions from module xinclude
  3555.     #
  3556.  
  3557.     def xincludeProcessTree(self):
  3558.         """Implement the XInclude substitution for the given subtree """
  3559.         ret = libxml2mod.xmlXIncludeProcessTree(self._o)
  3560.         return ret
  3561.  
  3562.     def xincludeProcessTreeFlags(self, flags):
  3563.         """Implement the XInclude substitution for the given subtree """
  3564.         ret = libxml2mod.xmlXIncludeProcessTreeFlags(self._o, flags)
  3565.         return ret
  3566.  
  3567.     #
  3568.     # xmlNode functions from module xmlschemas
  3569.     #
  3570.  
  3571.     def schemaValidateOneElement(self, ctxt):
  3572.         if ctxt is None: ctxt__o = None
  3573.         else: ctxt__o = ctxt._o
  3574.         ret = libxml2mod.xmlSchemaValidateOneElement(ctxt__o, self._o)
  3575.         return ret
  3576.  
  3577.     #
  3578.     # xmlNode functions from module xpath
  3579.     #
  3580.  
  3581.     def xpathCastNodeToNumber(self):
  3582.         """Converts a node to its number value """
  3583.         ret = libxml2mod.xmlXPathCastNodeToNumber(self._o)
  3584.         return ret
  3585.  
  3586.     def xpathCastNodeToString(self):
  3587.         """Converts a node to its string value. """
  3588.         ret = libxml2mod.xmlXPathCastNodeToString(self._o)
  3589.         return ret
  3590.  
  3591.     def xpathCmpNodes(self, node2):
  3592.         """Compare two nodes w.r.t document order """
  3593.         if node2 is None: node2__o = None
  3594.         else: node2__o = node2._o
  3595.         ret = libxml2mod.xmlXPathCmpNodes(self._o, node2__o)
  3596.         return ret
  3597.  
  3598.     #
  3599.     # xmlNode functions from module xpathInternals
  3600.     #
  3601.  
  3602.     def xpathNewNodeSet(self):
  3603.         """Create a new xmlXPathObjectPtr of type NodeSet and
  3604.            initialize it with the single Node @val """
  3605.         ret = libxml2mod.xmlXPathNewNodeSet(self._o)
  3606.         if ret is None:raise xpathError('xmlXPathNewNodeSet() failed')
  3607.         return xpathObjectRet(ret)
  3608.  
  3609.     def xpathNewValueTree(self):
  3610.         """Create a new xmlXPathObjectPtr of type Value Tree (XSLT)
  3611.            and initialize it with the tree root @val """
  3612.         ret = libxml2mod.xmlXPathNewValueTree(self._o)
  3613.         if ret is None:raise xpathError('xmlXPathNewValueTree() failed')
  3614.         return xpathObjectRet(ret)
  3615.  
  3616.     def xpathNextAncestor(self, ctxt):
  3617.         """Traversal function for the "ancestor" direction the
  3618.           ancestor axis contains the ancestors of the context node;
  3619.           the ancestors of the context node consist of the parent of
  3620.           context node and the parent's parent and so on; the nodes
  3621.           are ordered in reverse document order; thus the parent is
  3622.           the first node on the axis, and the parent's parent is the
  3623.            second node on the axis """
  3624.         if ctxt is None: ctxt__o = None
  3625.         else: ctxt__o = ctxt._o
  3626.         ret = libxml2mod.xmlXPathNextAncestor(ctxt__o, self._o)
  3627.         if ret is None:raise xpathError('xmlXPathNextAncestor() failed')
  3628.         __tmp = xmlNode(_obj=ret)
  3629.         return __tmp
  3630.  
  3631.     def xpathNextAncestorOrSelf(self, ctxt):
  3632.         """Traversal function for the "ancestor-or-self" direction he
  3633.           ancestor-or-self axis contains the context node and
  3634.           ancestors of the context node in reverse document order;
  3635.           thus the context node is the first node on the axis, and
  3636.           the context node's parent the second; parent here is
  3637.            defined the same as with the parent axis. """
  3638.         if ctxt is None: ctxt__o = None
  3639.         else: ctxt__o = ctxt._o
  3640.         ret = libxml2mod.xmlXPathNextAncestorOrSelf(ctxt__o, self._o)
  3641.         if ret is None:raise xpathError('xmlXPathNextAncestorOrSelf() failed')
  3642.         __tmp = xmlNode(_obj=ret)
  3643.         return __tmp
  3644.  
  3645.     def xpathNextAttribute(self, ctxt):
  3646.         """Traversal function for the "attribute" direction TODO:
  3647.            support DTD inherited default attributes """
  3648.         if ctxt is None: ctxt__o = None
  3649.         else: ctxt__o = ctxt._o
  3650.         ret = libxml2mod.xmlXPathNextAttribute(ctxt__o, self._o)
  3651.         if ret is None:raise xpathError('xmlXPathNextAttribute() failed')
  3652.         __tmp = xmlNode(_obj=ret)
  3653.         return __tmp
  3654.  
  3655.     def xpathNextChild(self, ctxt):
  3656.         """Traversal function for the "child" direction The child axis
  3657.           contains the children of the context node in document order. """
  3658.         if ctxt is None: ctxt__o = None
  3659.         else: ctxt__o = ctxt._o
  3660.         ret = libxml2mod.xmlXPathNextChild(ctxt__o, self._o)
  3661.         if ret is None:raise xpathError('xmlXPathNextChild() failed')
  3662.         __tmp = xmlNode(_obj=ret)
  3663.         return __tmp
  3664.  
  3665.     def xpathNextDescendant(self, ctxt):
  3666.         """Traversal function for the "descendant" direction the
  3667.           descendant axis contains the descendants of the context
  3668.           node in document order; a descendant is a child or a child
  3669.            of a child and so on. """
  3670.         if ctxt is None: ctxt__o = None
  3671.         else: ctxt__o = ctxt._o
  3672.         ret = libxml2mod.xmlXPathNextDescendant(ctxt__o, self._o)
  3673.         if ret is None:raise xpathError('xmlXPathNextDescendant() failed')
  3674.         __tmp = xmlNode(_obj=ret)
  3675.         return __tmp
  3676.  
  3677.     def xpathNextDescendantOrSelf(self, ctxt):
  3678.         """Traversal function for the "descendant-or-self" direction
  3679.           the descendant-or-self axis contains the context node and
  3680.           the descendants of the context node in document order; thus
  3681.           the context node is the first node on the axis, and the
  3682.           first child of the context node is the second node on the
  3683.            axis """
  3684.         if ctxt is None: ctxt__o = None
  3685.         else: ctxt__o = ctxt._o
  3686.         ret = libxml2mod.xmlXPathNextDescendantOrSelf(ctxt__o, self._o)
  3687.         if ret is None:raise xpathError('xmlXPathNextDescendantOrSelf() failed')
  3688.         __tmp = xmlNode(_obj=ret)
  3689.         return __tmp
  3690.  
  3691.     def xpathNextFollowing(self, ctxt):
  3692.         """Traversal function for the "following" direction The
  3693.           following axis contains all nodes in the same document as
  3694.           the context node that are after the context node in
  3695.           document order, excluding any descendants and excluding
  3696.           attribute nodes and namespace nodes; the nodes are ordered
  3697.            in document order """
  3698.         if ctxt is None: ctxt__o = None
  3699.         else: ctxt__o = ctxt._o
  3700.         ret = libxml2mod.xmlXPathNextFollowing(ctxt__o, self._o)
  3701.         if ret is None:raise xpathError('xmlXPathNextFollowing() failed')
  3702.         __tmp = xmlNode(_obj=ret)
  3703.         return __tmp
  3704.  
  3705.     def xpathNextFollowingSibling(self, ctxt):
  3706.         """Traversal function for the "following-sibling" direction
  3707.           The following-sibling axis contains the following siblings
  3708.            of the context node in document order. """
  3709.         if ctxt is None: ctxt__o = None
  3710.         else: ctxt__o = ctxt._o
  3711.         ret = libxml2mod.xmlXPathNextFollowingSibling(ctxt__o, self._o)
  3712.         if ret is None:raise xpathError('xmlXPathNextFollowingSibling() failed')
  3713.         __tmp = xmlNode(_obj=ret)
  3714.         return __tmp
  3715.  
  3716.     def xpathNextNamespace(self, ctxt):
  3717.         """Traversal function for the "namespace" direction the
  3718.           namespace axis contains the namespace nodes of the context
  3719.           node; the order of nodes on this axis is
  3720.           implementation-defined; the axis will be empty unless the
  3721.           context node is an element  We keep the XML namespace node
  3722.            at the end of the list. """
  3723.         if ctxt is None: ctxt__o = None
  3724.         else: ctxt__o = ctxt._o
  3725.         ret = libxml2mod.xmlXPathNextNamespace(ctxt__o, self._o)
  3726.         if ret is None:raise xpathError('xmlXPathNextNamespace() failed')
  3727.         __tmp = xmlNode(_obj=ret)
  3728.         return __tmp
  3729.  
  3730.     def xpathNextParent(self, ctxt):
  3731.         """Traversal function for the "parent" direction The parent
  3732.           axis contains the parent of the context node, if there is
  3733.            one. """
  3734.         if ctxt is None: ctxt__o = None
  3735.         else: ctxt__o = ctxt._o
  3736.         ret = libxml2mod.xmlXPathNextParent(ctxt__o, self._o)
  3737.         if ret is None:raise xpathError('xmlXPathNextParent() failed')
  3738.         __tmp = xmlNode(_obj=ret)
  3739.         return __tmp
  3740.  
  3741.     def xpathNextPreceding(self, ctxt):
  3742.         """Traversal function for the "preceding" direction the
  3743.           preceding axis contains all nodes in the same document as
  3744.           the context node that are before the context node in
  3745.           document order, excluding any ancestors and excluding
  3746.           attribute nodes and namespace nodes; the nodes are ordered
  3747.            in reverse document order """
  3748.         if ctxt is None: ctxt__o = None
  3749.         else: ctxt__o = ctxt._o
  3750.         ret = libxml2mod.xmlXPathNextPreceding(ctxt__o, self._o)
  3751.         if ret is None:raise xpathError('xmlXPathNextPreceding() failed')
  3752.         __tmp = xmlNode(_obj=ret)
  3753.         return __tmp
  3754.  
  3755.     def xpathNextPrecedingSibling(self, ctxt):
  3756.         """Traversal function for the "preceding-sibling" direction
  3757.           The preceding-sibling axis contains the preceding siblings
  3758.           of the context node in reverse document order; the first
  3759.           preceding sibling is first on the axis; the sibling
  3760.            preceding that node is the second on the axis and so on. """
  3761.         if ctxt is None: ctxt__o = None
  3762.         else: ctxt__o = ctxt._o
  3763.         ret = libxml2mod.xmlXPathNextPrecedingSibling(ctxt__o, self._o)
  3764.         if ret is None:raise xpathError('xmlXPathNextPrecedingSibling() failed')
  3765.         __tmp = xmlNode(_obj=ret)
  3766.         return __tmp
  3767.  
  3768.     def xpathNextSelf(self, ctxt):
  3769.         """Traversal function for the "self" direction The self axis
  3770.            contains just the context node itself """
  3771.         if ctxt is None: ctxt__o = None
  3772.         else: ctxt__o = ctxt._o
  3773.         ret = libxml2mod.xmlXPathNextSelf(ctxt__o, self._o)
  3774.         if ret is None:raise xpathError('xmlXPathNextSelf() failed')
  3775.         __tmp = xmlNode(_obj=ret)
  3776.         return __tmp
  3777.  
  3778.     #
  3779.     # xmlNode functions from module xpointer
  3780.     #
  3781.  
  3782.     def xpointerNewCollapsedRange(self):
  3783.         """Create a new xmlXPathObjectPtr of type range using a single
  3784.            nodes """
  3785.         ret = libxml2mod.xmlXPtrNewCollapsedRange(self._o)
  3786.         if ret is None:raise treeError('xmlXPtrNewCollapsedRange() failed')
  3787.         return xpathObjectRet(ret)
  3788.  
  3789.     def xpointerNewContext(self, doc, origin):
  3790.         """Create a new XPointer context """
  3791.         if doc is None: doc__o = None
  3792.         else: doc__o = doc._o
  3793.         if origin is None: origin__o = None
  3794.         else: origin__o = origin._o
  3795.         ret = libxml2mod.xmlXPtrNewContext(doc__o, self._o, origin__o)
  3796.         if ret is None:raise treeError('xmlXPtrNewContext() failed')
  3797.         __tmp = xpathContext(_obj=ret)
  3798.         return __tmp
  3799.  
  3800.     def xpointerNewLocationSetNodes(self, end):
  3801.         """Create a new xmlXPathObjectPtr of type LocationSet and
  3802.           initialize it with the single range made of the two nodes
  3803.            @start and @end """
  3804.         if end is None: end__o = None
  3805.         else: end__o = end._o
  3806.         ret = libxml2mod.xmlXPtrNewLocationSetNodes(self._o, end__o)
  3807.         if ret is None:raise treeError('xmlXPtrNewLocationSetNodes() failed')
  3808.         return xpathObjectRet(ret)
  3809.  
  3810.     def xpointerNewRange(self, startindex, end, endindex):
  3811.         """Create a new xmlXPathObjectPtr of type range """
  3812.         if end is None: end__o = None
  3813.         else: end__o = end._o
  3814.         ret = libxml2mod.xmlXPtrNewRange(self._o, startindex, end__o, endindex)
  3815.         if ret is None:raise treeError('xmlXPtrNewRange() failed')
  3816.         return xpathObjectRet(ret)
  3817.  
  3818.     def xpointerNewRangeNodes(self, end):
  3819.         """Create a new xmlXPathObjectPtr of type range using 2 nodes """
  3820.         if end is None: end__o = None
  3821.         else: end__o = end._o
  3822.         ret = libxml2mod.xmlXPtrNewRangeNodes(self._o, end__o)
  3823.         if ret is None:raise treeError('xmlXPtrNewRangeNodes() failed')
  3824.         return xpathObjectRet(ret)
  3825.  
  3826. class xmlDoc(xmlNode):
  3827.     def __init__(self, _obj=None):
  3828.         if type(_obj).__name__ != 'PyCObject':
  3829.             raise TypeError, 'xmlDoc needs a PyCObject argument'
  3830.         self._o = _obj
  3831.         xmlNode.__init__(self, _obj=_obj)
  3832.  
  3833.     def __repr__(self):
  3834.         return "<xmlDoc (%s) object at 0x%x>" % (self.name, long(pos_id (self)))
  3835.  
  3836.     #
  3837.     # xmlDoc functions from module HTMLparser
  3838.     #
  3839.  
  3840.     def htmlAutoCloseTag(self, name, elem):
  3841.         """The HTML DTD allows a tag to implicitly close other tags.
  3842.           The list is kept in htmlStartClose array. This function
  3843.           checks if the element or one of it's children would
  3844.            autoclose the given tag. """
  3845.         ret = libxml2mod.htmlAutoCloseTag(self._o, name, elem)
  3846.         return ret
  3847.  
  3848.     def htmlIsAutoClosed(self, elem):
  3849.         """The HTML DTD allows a tag to implicitly close other tags.
  3850.           The list is kept in htmlStartClose array. This function
  3851.            checks if a tag is autoclosed by one of it's child """
  3852.         ret = libxml2mod.htmlIsAutoClosed(self._o, elem)
  3853.         return ret
  3854.  
  3855.     #
  3856.     # xmlDoc functions from module HTMLtree
  3857.     #
  3858.  
  3859.     def htmlDocContentDumpFormatOutput(self, buf, encoding, format):
  3860.         """Dump an HTML document. """
  3861.         if buf is None: buf__o = None
  3862.         else: buf__o = buf._o
  3863.         libxml2mod.htmlDocContentDumpFormatOutput(buf__o, self._o, encoding, format)
  3864.  
  3865.     def htmlDocContentDumpOutput(self, buf, encoding):
  3866.         """Dump an HTML document. Formating return/spaces are added. """
  3867.         if buf is None: buf__o = None
  3868.         else: buf__o = buf._o
  3869.         libxml2mod.htmlDocContentDumpOutput(buf__o, self._o, encoding)
  3870.  
  3871.     def htmlDocDump(self, f):
  3872.         """Dump an HTML document to an open FILE. """
  3873.         ret = libxml2mod.htmlDocDump(f, self._o)
  3874.         return ret
  3875.  
  3876.     def htmlGetMetaEncoding(self):
  3877.         """Encoding definition lookup in the Meta tags """
  3878.         ret = libxml2mod.htmlGetMetaEncoding(self._o)
  3879.         return ret
  3880.  
  3881.     def htmlNodeDumpFile(self, out, cur):
  3882.         """Dump an HTML node, recursive behaviour,children are printed
  3883.            too, and formatting returns are added. """
  3884.         if cur is None: cur__o = None
  3885.         else: cur__o = cur._o
  3886.         libxml2mod.htmlNodeDumpFile(out, self._o, cur__o)
  3887.  
  3888.     def htmlNodeDumpFileFormat(self, out, cur, encoding, format):
  3889.         """Dump an HTML node, recursive behaviour,children are printed
  3890.           too.  TODO: if encoding == None try to save in the doc
  3891.            encoding """
  3892.         if cur is None: cur__o = None
  3893.         else: cur__o = cur._o
  3894.         ret = libxml2mod.htmlNodeDumpFileFormat(out, self._o, cur__o, encoding, format)
  3895.         return ret
  3896.  
  3897.     def htmlNodeDumpFormatOutput(self, buf, cur, encoding, format):
  3898.         """Dump an HTML node, recursive behaviour,children are printed
  3899.            too. """
  3900.         if buf is None: buf__o = None
  3901.         else: buf__o = buf._o
  3902.         if cur is None: cur__o = None
  3903.         else: cur__o = cur._o
  3904.         libxml2mod.htmlNodeDumpFormatOutput(buf__o, self._o, cur__o, encoding, format)
  3905.  
  3906.     def htmlNodeDumpOutput(self, buf, cur, encoding):
  3907.         """Dump an HTML node, recursive behaviour,children are printed
  3908.            too, and formatting returns/spaces are added. """
  3909.         if buf is None: buf__o = None
  3910.         else: buf__o = buf._o
  3911.         if cur is None: cur__o = None
  3912.         else: cur__o = cur._o
  3913.         libxml2mod.htmlNodeDumpOutput(buf__o, self._o, cur__o, encoding)
  3914.  
  3915.     def htmlSaveFile(self, filename):
  3916.         """Dump an HTML document to a file. If @filename is "-" the
  3917.            stdout file is used. """
  3918.         ret = libxml2mod.htmlSaveFile(filename, self._o)
  3919.         return ret
  3920.  
  3921.     def htmlSaveFileEnc(self, filename, encoding):
  3922.         """Dump an HTML document to a file using a given encoding and
  3923.            formatting returns/spaces are added. """
  3924.         ret = libxml2mod.htmlSaveFileEnc(filename, self._o, encoding)
  3925.         return ret
  3926.  
  3927.     def htmlSaveFileFormat(self, filename, encoding, format):
  3928.         """Dump an HTML document to a file using a given encoding. """
  3929.         ret = libxml2mod.htmlSaveFileFormat(filename, self._o, encoding, format)
  3930.         return ret
  3931.  
  3932.     def htmlSetMetaEncoding(self, encoding):
  3933.         """Sets the current encoding in the Meta tags NOTE: this will
  3934.           not change the document content encoding, just the META
  3935.            flag associated. """
  3936.         ret = libxml2mod.htmlSetMetaEncoding(self._o, encoding)
  3937.         return ret
  3938.  
  3939.     #
  3940.     # xmlDoc functions from module debugXML
  3941.     #
  3942.  
  3943.     def debugCheckDocument(self, output):
  3944.         """Check the document for potential content problems, and
  3945.            output the errors to @output """
  3946.         ret = libxml2mod.xmlDebugCheckDocument(output, self._o)
  3947.         return ret
  3948.  
  3949.     def debugDumpDocument(self, output):
  3950.         """Dumps debug information for the document, it's recursive """
  3951.         libxml2mod.xmlDebugDumpDocument(output, self._o)
  3952.  
  3953.     def debugDumpDocumentHead(self, output):
  3954.         """Dumps debug information cncerning the document, not
  3955.            recursive """
  3956.         libxml2mod.xmlDebugDumpDocumentHead(output, self._o)
  3957.  
  3958.     def debugDumpEntities(self, output):
  3959.         """Dumps debug information for all the entities in use by the
  3960.            document """
  3961.         libxml2mod.xmlDebugDumpEntities(output, self._o)
  3962.  
  3963.     #
  3964.     # xmlDoc functions from module entities
  3965.     #
  3966.  
  3967.     def addDocEntity(self, name, type, ExternalID, SystemID, content):
  3968.         """Register a new entity for this document. """
  3969.         ret = libxml2mod.xmlAddDocEntity(self._o, name, type, ExternalID, SystemID, content)
  3970.         if ret is None:raise treeError('xmlAddDocEntity() failed')
  3971.         __tmp = xmlEntity(_obj=ret)
  3972.         return __tmp
  3973.  
  3974.     def addDtdEntity(self, name, type, ExternalID, SystemID, content):
  3975.         """Register a new entity for this document DTD external subset. """
  3976.         ret = libxml2mod.xmlAddDtdEntity(self._o, name, type, ExternalID, SystemID, content)
  3977.         if ret is None:raise treeError('xmlAddDtdEntity() failed')
  3978.         __tmp = xmlEntity(_obj=ret)
  3979.         return __tmp
  3980.  
  3981.     def docEntity(self, name):
  3982.         """Do an entity lookup in the document entity hash table and """
  3983.         ret = libxml2mod.xmlGetDocEntity(self._o, name)
  3984.         if ret is None:raise treeError('xmlGetDocEntity() failed')
  3985.         __tmp = xmlEntity(_obj=ret)
  3986.         return __tmp
  3987.  
  3988.     def dtdEntity(self, name):
  3989.         """Do an entity lookup in the DTD entity hash table and """
  3990.         ret = libxml2mod.xmlGetDtdEntity(self._o, name)
  3991.         if ret is None:raise treeError('xmlGetDtdEntity() failed')
  3992.         __tmp = xmlEntity(_obj=ret)
  3993.         return __tmp
  3994.  
  3995.     def encodeEntities(self, input):
  3996.         """TODO: remove xmlEncodeEntities, once we are not afraid of
  3997.           breaking binary compatibility  People must migrate their
  3998.           code to xmlEncodeEntitiesReentrant ! This routine will
  3999.            issue a warning when encountered. """
  4000.         ret = libxml2mod.xmlEncodeEntities(self._o, input)
  4001.         return ret
  4002.  
  4003.     def encodeEntitiesReentrant(self, input):
  4004.         """Do a global encoding of a string, replacing the predefined
  4005.           entities and non ASCII values with their entities and
  4006.           CharRef counterparts. Contrary to xmlEncodeEntities, this
  4007.            routine is reentrant, and result must be deallocated. """
  4008.         ret = libxml2mod.xmlEncodeEntitiesReentrant(self._o, input)
  4009.         return ret
  4010.  
  4011.     def encodeSpecialChars(self, input):
  4012.         """Do a global encoding of a string, replacing the predefined
  4013.           entities this routine is reentrant, and result must be
  4014.            deallocated. """
  4015.         ret = libxml2mod.xmlEncodeSpecialChars(self._o, input)
  4016.         return ret
  4017.  
  4018.     def parameterEntity(self, name):
  4019.         """Do an entity lookup in the internal and external subsets and """
  4020.         ret = libxml2mod.xmlGetParameterEntity(self._o, name)
  4021.         if ret is None:raise treeError('xmlGetParameterEntity() failed')
  4022.         __tmp = xmlEntity(_obj=ret)
  4023.         return __tmp
  4024.  
  4025.     #
  4026.     # xmlDoc functions from module relaxng
  4027.     #
  4028.  
  4029.     def relaxNGNewDocParserCtxt(self):
  4030.         """Create an XML RelaxNGs parser context for that document.
  4031.           Note: since the process of compiling a RelaxNG schemas
  4032.           modifies the document, the @doc parameter is duplicated
  4033.            internally. """
  4034.         ret = libxml2mod.xmlRelaxNGNewDocParserCtxt(self._o)
  4035.         if ret is None:raise parserError('xmlRelaxNGNewDocParserCtxt() failed')
  4036.         __tmp = relaxNgParserCtxt(_obj=ret)
  4037.         return __tmp
  4038.  
  4039.     def relaxNGValidateDoc(self, ctxt):
  4040.         """Validate a document tree in memory. """
  4041.         if ctxt is None: ctxt__o = None
  4042.         else: ctxt__o = ctxt._o
  4043.         ret = libxml2mod.xmlRelaxNGValidateDoc(ctxt__o, self._o)
  4044.         return ret
  4045.  
  4046.     def relaxNGValidateFullElement(self, ctxt, elem):
  4047.         """Validate a full subtree when
  4048.           xmlRelaxNGValidatePushElement() returned 0 and the content
  4049.            of the node has been expanded. """
  4050.         if ctxt is None: ctxt__o = None
  4051.         else: ctxt__o = ctxt._o
  4052.         if elem is None: elem__o = None
  4053.         else: elem__o = elem._o
  4054.         ret = libxml2mod.xmlRelaxNGValidateFullElement(ctxt__o, self._o, elem__o)
  4055.         return ret
  4056.  
  4057.     def relaxNGValidatePopElement(self, ctxt, elem):
  4058.         """Pop the element end from the RelaxNG validation stack. """
  4059.         if ctxt is None: ctxt__o = None
  4060.         else: ctxt__o = ctxt._o
  4061.         if elem is None: elem__o = None
  4062.         else: elem__o = elem._o
  4063.         ret = libxml2mod.xmlRelaxNGValidatePopElement(ctxt__o, self._o, elem__o)
  4064.         return ret
  4065.  
  4066.     def relaxNGValidatePushElement(self, ctxt, elem):
  4067.         """Push a new element start on the RelaxNG validation stack. """
  4068.         if ctxt is None: ctxt__o = None
  4069.         else: ctxt__o = ctxt._o
  4070.         if elem is None: elem__o = None
  4071.         else: elem__o = elem._o
  4072.         ret = libxml2mod.xmlRelaxNGValidatePushElement(ctxt__o, self._o, elem__o)
  4073.         return ret
  4074.  
  4075.     #
  4076.     # xmlDoc functions from module tree
  4077.     #
  4078.  
  4079.     def copyDoc(self, recursive):
  4080.         """Do a copy of the document info. If recursive, the content
  4081.           tree will be copied too as well as DTD, namespaces and
  4082.            entities. """
  4083.         ret = libxml2mod.xmlCopyDoc(self._o, recursive)
  4084.         if ret is None:raise treeError('xmlCopyDoc() failed')
  4085.         __tmp = xmlDoc(_obj=ret)
  4086.         return __tmp
  4087.  
  4088.     def copyNode(self, node, extended):
  4089.         """Do a copy of the node to a given document. """
  4090.         if node is None: node__o = None
  4091.         else: node__o = node._o
  4092.         ret = libxml2mod.xmlDocCopyNode(node__o, self._o, extended)
  4093.         if ret is None:raise treeError('xmlDocCopyNode() failed')
  4094.         __tmp = xmlNode(_obj=ret)
  4095.         return __tmp
  4096.  
  4097.     def copyNodeList(self, node):
  4098.         """Do a recursive copy of the node list. """
  4099.         if node is None: node__o = None
  4100.         else: node__o = node._o
  4101.         ret = libxml2mod.xmlDocCopyNodeList(self._o, node__o)
  4102.         if ret is None:raise treeError('xmlDocCopyNodeList() failed')
  4103.         __tmp = xmlNode(_obj=ret)
  4104.         return __tmp
  4105.  
  4106.     def createIntSubset(self, name, ExternalID, SystemID):
  4107.         """Create the internal subset of a document """
  4108.         ret = libxml2mod.xmlCreateIntSubset(self._o, name, ExternalID, SystemID)
  4109.         if ret is None:raise treeError('xmlCreateIntSubset() failed')
  4110.         __tmp = xmlDtd(_obj=ret)
  4111.         return __tmp
  4112.  
  4113.     def docCompressMode(self):
  4114.         """get the compression ratio for a document, ZLIB based """
  4115.         ret = libxml2mod.xmlGetDocCompressMode(self._o)
  4116.         return ret
  4117.  
  4118.     def dump(self, f):
  4119.         """Dump an XML document to an open FILE. """
  4120.         ret = libxml2mod.xmlDocDump(f, self._o)
  4121.         return ret
  4122.  
  4123.     def elemDump(self, f, cur):
  4124.         """Dump an XML/HTML node, recursive behaviour, children are
  4125.            printed too. """
  4126.         if cur is None: cur__o = None
  4127.         else: cur__o = cur._o
  4128.         libxml2mod.xmlElemDump(f, self._o, cur__o)
  4129.  
  4130.     def formatDump(self, f, format):
  4131.         """Dump an XML document to an open FILE. """
  4132.         ret = libxml2mod.xmlDocFormatDump(f, self._o, format)
  4133.         return ret
  4134.  
  4135.     def freeDoc(self):
  4136.         """Free up all the structures used by a document, tree
  4137.            included. """
  4138.         libxml2mod.xmlFreeDoc(self._o)
  4139.  
  4140.     def getRootElement(self):
  4141.         """Get the root element of the document (doc->children is a
  4142.            list containing possibly comments, PIs, etc ...). """
  4143.         ret = libxml2mod.xmlDocGetRootElement(self._o)
  4144.         if ret is None:raise treeError('xmlDocGetRootElement() failed')
  4145.         __tmp = xmlNode(_obj=ret)
  4146.         return __tmp
  4147.  
  4148.     def intSubset(self):
  4149.         """Get the internal subset of a document """
  4150.         ret = libxml2mod.xmlGetIntSubset(self._o)
  4151.         if ret is None:raise treeError('xmlGetIntSubset() failed')
  4152.         __tmp = xmlDtd(_obj=ret)
  4153.         return __tmp
  4154.  
  4155.     def newCDataBlock(self, content, len):
  4156.         """Creation of a new node containing a CDATA block. """
  4157.         ret = libxml2mod.xmlNewCDataBlock(self._o, content, len)
  4158.         if ret is None:raise treeError('xmlNewCDataBlock() failed')
  4159.         __tmp = xmlNode(_obj=ret)
  4160.         return __tmp
  4161.  
  4162.     def newCharRef(self, name):
  4163.         """Creation of a new character reference node. """
  4164.         ret = libxml2mod.xmlNewCharRef(self._o, name)
  4165.         if ret is None:raise treeError('xmlNewCharRef() failed')
  4166.         __tmp = xmlNode(_obj=ret)
  4167.         return __tmp
  4168.  
  4169.     def newDocComment(self, content):
  4170.         """Creation of a new node containing a comment within a
  4171.            document. """
  4172.         ret = libxml2mod.xmlNewDocComment(self._o, content)
  4173.         if ret is None:raise treeError('xmlNewDocComment() failed')
  4174.         __tmp = xmlNode(_obj=ret)
  4175.         return __tmp
  4176.  
  4177.     def newDocFragment(self):
  4178.         """Creation of a new Fragment node. """
  4179.         ret = libxml2mod.xmlNewDocFragment(self._o)
  4180.         if ret is None:raise treeError('xmlNewDocFragment() failed')
  4181.         __tmp = xmlNode(_obj=ret)
  4182.         return __tmp
  4183.  
  4184.     def newDocNode(self, ns, name, content):
  4185.         """Creation of a new node element within a document. @ns and
  4186.           @content are optional (None). NOTE: @content is supposed to
  4187.           be a piece of XML CDATA, so it allow entities references,
  4188.           but XML special chars need to be escaped first by using
  4189.           xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you
  4190.            don't need entities support. """
  4191.         if ns is None: ns__o = None
  4192.         else: ns__o = ns._o
  4193.         ret = libxml2mod.xmlNewDocNode(self._o, ns__o, name, content)
  4194.         if ret is None:raise treeError('xmlNewDocNode() failed')
  4195.         __tmp = xmlNode(_obj=ret)
  4196.         return __tmp
  4197.  
  4198.     def newDocNodeEatName(self, ns, name, content):
  4199.         """Creation of a new node element within a document. @ns and
  4200.           @content are optional (None). NOTE: @content is supposed to
  4201.           be a piece of XML CDATA, so it allow entities references,
  4202.           but XML special chars need to be escaped first by using
  4203.           xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you
  4204.            don't need entities support. """
  4205.         if ns is None: ns__o = None
  4206.         else: ns__o = ns._o
  4207.         ret = libxml2mod.xmlNewDocNodeEatName(self._o, ns__o, name, content)
  4208.         if ret is None:raise treeError('xmlNewDocNodeEatName() failed')
  4209.         __tmp = xmlNode(_obj=ret)
  4210.         return __tmp
  4211.  
  4212.     def newDocPI(self, name, content):
  4213.         """Creation of a processing instruction element. """
  4214.         ret = libxml2mod.xmlNewDocPI(self._o, name, content)
  4215.         if ret is None:raise treeError('xmlNewDocPI() failed')
  4216.         __tmp = xmlNode(_obj=ret)
  4217.         return __tmp
  4218.  
  4219.     def newDocProp(self, name, value):
  4220.         """Create a new property carried by a document. """
  4221.         ret = libxml2mod.xmlNewDocProp(self._o, name, value)
  4222.         if ret is None:raise treeError('xmlNewDocProp() failed')
  4223.         __tmp = xmlAttr(_obj=ret)
  4224.         return __tmp
  4225.  
  4226.     def newDocRawNode(self, ns, name, content):
  4227.         """Creation of a new node element within a document. @ns and
  4228.            @content are optional (None). """
  4229.         if ns is None: ns__o = None
  4230.         else: ns__o = ns._o
  4231.         ret = libxml2mod.xmlNewDocRawNode(self._o, ns__o, name, content)
  4232.         if ret is None:raise treeError('xmlNewDocRawNode() failed')
  4233.         __tmp = xmlNode(_obj=ret)
  4234.         return __tmp
  4235.  
  4236.     def newDocText(self, content):
  4237.         """Creation of a new text node within a document. """
  4238.         ret = libxml2mod.xmlNewDocText(self._o, content)
  4239.         if ret is None:raise treeError('xmlNewDocText() failed')
  4240.         __tmp = xmlNode(_obj=ret)
  4241.         return __tmp
  4242.  
  4243.     def newDocTextLen(self, content, len):
  4244.         """Creation of a new text node with an extra content length
  4245.            parameter. The text node pertain to a given document. """
  4246.         ret = libxml2mod.xmlNewDocTextLen(self._o, content, len)
  4247.         if ret is None:raise treeError('xmlNewDocTextLen() failed')
  4248.         __tmp = xmlNode(_obj=ret)
  4249.         return __tmp
  4250.  
  4251.     def newDtd(self, name, ExternalID, SystemID):
  4252.         """Creation of a new DTD for the external subset. To create an
  4253.            internal subset, use xmlCreateIntSubset(). """
  4254.         ret = libxml2mod.xmlNewDtd(self._o, name, ExternalID, SystemID)
  4255.         if ret is None:raise treeError('xmlNewDtd() failed')
  4256.         __tmp = xmlDtd(_obj=ret)
  4257.         return __tmp
  4258.  
  4259.     def newGlobalNs(self, href, prefix):
  4260.         """Creation of a Namespace, the old way using PI and without
  4261.            scoping DEPRECATED !!! """
  4262.         ret = libxml2mod.xmlNewGlobalNs(self._o, href, prefix)
  4263.         if ret is None:raise treeError('xmlNewGlobalNs() failed')
  4264.         __tmp = xmlNs(_obj=ret)
  4265.         return __tmp
  4266.  
  4267.     def newReference(self, name):
  4268.         """Creation of a new reference node. """
  4269.         ret = libxml2mod.xmlNewReference(self._o, name)
  4270.         if ret is None:raise treeError('xmlNewReference() failed')
  4271.         __tmp = xmlNode(_obj=ret)
  4272.         return __tmp
  4273.  
  4274.     def nodeDumpOutput(self, buf, cur, level, format, encoding):
  4275.         """Dump an XML node, recursive behaviour, children are printed
  4276.           too. Note that @format = 1 provide node indenting only if
  4277.           xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was
  4278.            called """
  4279.         if buf is None: buf__o = None
  4280.         else: buf__o = buf._o
  4281.         if cur is None: cur__o = None
  4282.         else: cur__o = cur._o
  4283.         libxml2mod.xmlNodeDumpOutput(buf__o, self._o, cur__o, level, format, encoding)
  4284.  
  4285.     def nodeGetBase(self, cur):
  4286.         """Searches for the BASE URL. The code should work on both XML
  4287.           and HTML document even if base mechanisms are completely
  4288.           different. It returns the base as defined in RFC 2396
  4289.           sections 5.1.1. Base URI within Document Content and 5.1.2.
  4290.           Base URI from the Encapsulating Entity However it does not
  4291.           return the document base (5.1.3), use xmlDocumentGetBase()
  4292.            for this """
  4293.         if cur is None: cur__o = None
  4294.         else: cur__o = cur._o
  4295.         ret = libxml2mod.xmlNodeGetBase(self._o, cur__o)
  4296.         return ret
  4297.  
  4298.     def nodeListGetRawString(self, list, inLine):
  4299.         """Builds the string equivalent to the text contained in the
  4300.           Node list made of TEXTs and ENTITY_REFs, contrary to
  4301.           xmlNodeListGetString() this function doesn't do any
  4302.            character encoding handling. """
  4303.         if list is None: list__o = None
  4304.         else: list__o = list._o
  4305.         ret = libxml2mod.xmlNodeListGetRawString(self._o, list__o, inLine)
  4306.         return ret
  4307.  
  4308.     def nodeListGetString(self, list, inLine):
  4309.         """Build the string equivalent to the text contained in the
  4310.            Node list made of TEXTs and ENTITY_REFs """
  4311.         if list is None: list__o = None
  4312.         else: list__o = list._o
  4313.         ret = libxml2mod.xmlNodeListGetString(self._o, list__o, inLine)
  4314.         return ret
  4315.  
  4316.     def reconciliateNs(self, tree):
  4317.         """This function checks that all the namespaces declared
  4318.           within the given tree are properly declared. This is needed
  4319.           for example after Copy or Cut and then paste operations.
  4320.           The subtree may still hold pointers to namespace
  4321.           declarations outside the subtree or invalid/masked. As much
  4322.           as possible the function try to reuse the existing
  4323.           namespaces found in the new environment. If not possible
  4324.           the new namespaces are redeclared on @tree at the top of
  4325.            the given subtree. """
  4326.         if tree is None: tree__o = None
  4327.         else: tree__o = tree._o
  4328.         ret = libxml2mod.xmlReconciliateNs(self._o, tree__o)
  4329.         return ret
  4330.  
  4331.     def saveFile(self, filename):
  4332.         """Dump an XML document to a file. Will use compression if
  4333.           compiled in and enabled. If @filename is "-" the stdout
  4334.            file is used. """
  4335.         ret = libxml2mod.xmlSaveFile(filename, self._o)
  4336.         return ret
  4337.  
  4338.     def saveFileEnc(self, filename, encoding):
  4339.         """Dump an XML document, converting it to the given encoding """
  4340.         ret = libxml2mod.xmlSaveFileEnc(filename, self._o, encoding)
  4341.         return ret
  4342.  
  4343.     def saveFileTo(self, buf, encoding):
  4344.         """Dump an XML document to an I/O buffer. Warning ! This call
  4345.           xmlOutputBufferClose() on buf which is not available after
  4346.            this call. """
  4347.         if buf is None: buf__o = None
  4348.         else: buf__o = buf._o
  4349.         ret = libxml2mod.xmlSaveFileTo(buf__o, self._o, encoding)
  4350.         return ret
  4351.  
  4352.     def saveFormatFile(self, filename, format):
  4353.         """Dump an XML document to a file. Will use compression if
  4354.           compiled in and enabled. If @filename is "-" the stdout
  4355.           file is used. If @format is set then the document will be
  4356.           indented on output. Note that @format = 1 provide node
  4357.           indenting only if xmlIndentTreeOutput = 1 or
  4358.            xmlKeepBlanksDefault(0) was called """
  4359.         ret = libxml2mod.xmlSaveFormatFile(filename, self._o, format)
  4360.         return ret
  4361.  
  4362.     def saveFormatFileEnc(self, filename, encoding, format):
  4363.         """Dump an XML document to a file or an URL. """
  4364.         ret = libxml2mod.xmlSaveFormatFileEnc(filename, self._o, encoding, format)
  4365.         return ret
  4366.  
  4367.     def saveFormatFileTo(self, buf, encoding, format):
  4368.         """Dump an XML document to an I/O buffer. Warning ! This call
  4369.           xmlOutputBufferClose() on buf which is not available after
  4370.            this call. """
  4371.         if buf is None: buf__o = None
  4372.         else: buf__o = buf._o
  4373.         ret = libxml2mod.xmlSaveFormatFileTo(buf__o, self._o, encoding, format)
  4374.         return ret
  4375.  
  4376.     def searchNs(self, node, nameSpace):
  4377.         """Search a Ns registered under a given name space for a
  4378.           document. recurse on the parents until it finds the defined
  4379.           namespace or return None otherwise. @nameSpace can be None,
  4380.           this is a search for the default namespace. We don't allow
  4381.           to cross entities boundaries. If you don't declare the
  4382.           namespace within those you will be in troubles !!! A
  4383.            warning is generated to cover this case. """
  4384.         if node is None: node__o = None
  4385.         else: node__o = node._o
  4386.         ret = libxml2mod.xmlSearchNs(self._o, node__o, nameSpace)
  4387.         if ret is None:raise treeError('xmlSearchNs() failed')
  4388.         __tmp = xmlNs(_obj=ret)
  4389.         return __tmp
  4390.  
  4391.     def searchNsByHref(self, node, href):
  4392.         """Search a Ns aliasing a given URI. Recurse on the parents
  4393.           until it finds the defined namespace or return None
  4394.            otherwise. """
  4395.         if node is None: node__o = None
  4396.         else: node__o = node._o
  4397.         ret = libxml2mod.xmlSearchNsByHref(self._o, node__o, href)
  4398.         if ret is None:raise treeError('xmlSearchNsByHref() failed')
  4399.         __tmp = xmlNs(_obj=ret)
  4400.         return __tmp
  4401.  
  4402.     def setDocCompressMode(self, mode):
  4403.         """set the compression ratio for a document, ZLIB based
  4404.            Correct values: 0 (uncompressed) to 9 (max compression) """
  4405.         libxml2mod.xmlSetDocCompressMode(self._o, mode)
  4406.  
  4407.     def setListDoc(self, list):
  4408.         """update all nodes in the list to point to the right document """
  4409.         if list is None: list__o = None
  4410.         else: list__o = list._o
  4411.         libxml2mod.xmlSetListDoc(list__o, self._o)
  4412.  
  4413.     def setRootElement(self, root):
  4414.         """Set the root element of the document (doc->children is a
  4415.            list containing possibly comments, PIs, etc ...). """
  4416.         if root is None: root__o = None
  4417.         else: root__o = root._o
  4418.         ret = libxml2mod.xmlDocSetRootElement(self._o, root__o)
  4419.         if ret is None:return None
  4420.         __tmp = xmlNode(_obj=ret)
  4421.         return __tmp
  4422.  
  4423.     def setTreeDoc(self, tree):
  4424.         """update all nodes under the tree to point to the right
  4425.            document """
  4426.         if tree is None: tree__o = None
  4427.         else: tree__o = tree._o
  4428.         libxml2mod.xmlSetTreeDoc(tree__o, self._o)
  4429.  
  4430.     def stringGetNodeList(self, value):
  4431.         """Parse the value string and build the node list associated.
  4432.            Should produce a flat tree with only TEXTs and ENTITY_REFs. """
  4433.         ret = libxml2mod.xmlStringGetNodeList(self._o, value)
  4434.         if ret is None:raise treeError('xmlStringGetNodeList() failed')
  4435.         __tmp = xmlNode(_obj=ret)
  4436.         return __tmp
  4437.  
  4438.     def stringLenGetNodeList(self, value, len):
  4439.         """Parse the value string and build the node list associated.
  4440.            Should produce a flat tree with only TEXTs and ENTITY_REFs. """
  4441.         ret = libxml2mod.xmlStringLenGetNodeList(self._o, value, len)
  4442.         if ret is None:raise treeError('xmlStringLenGetNodeList() failed')
  4443.         __tmp = xmlNode(_obj=ret)
  4444.         return __tmp
  4445.  
  4446.     #
  4447.     # xmlDoc functions from module valid
  4448.     #
  4449.  
  4450.     def ID(self, ID):
  4451.         """Search the attribute declaring the given ID """
  4452.         ret = libxml2mod.xmlGetID(self._o, ID)
  4453.         if ret is None:raise treeError('xmlGetID() failed')
  4454.         __tmp = xmlAttr(_obj=ret)
  4455.         return __tmp
  4456.  
  4457.     def isID(self, elem, attr):
  4458.         """Determine whether an attribute is of type ID. In case we
  4459.           have DTD(s) then this is done if DTD loading has been
  4460.           requested. In the case of HTML documents parsed with the
  4461.            HTML parser, then ID detection is done systematically. """
  4462.         if elem is None: elem__o = None
  4463.         else: elem__o = elem._o
  4464.         if attr is None: attr__o = None
  4465.         else: attr__o = attr._o
  4466.         ret = libxml2mod.xmlIsID(self._o, elem__o, attr__o)
  4467.         return ret
  4468.  
  4469.     def isMixedElement(self, name):
  4470.         """Search in the DtDs whether an element accept Mixed content
  4471.            (or ANY) basically if it is supposed to accept text childs """
  4472.         ret = libxml2mod.xmlIsMixedElement(self._o, name)
  4473.         return ret
  4474.  
  4475.     def isRef(self, elem, attr):
  4476.         """Determine whether an attribute is of type Ref. In case we
  4477.           have DTD(s) then this is simple, otherwise we use an
  4478.            heuristic: name Ref (upper or lowercase). """
  4479.         if elem is None: elem__o = None
  4480.         else: elem__o = elem._o
  4481.         if attr is None: attr__o = None
  4482.         else: attr__o = attr._o
  4483.         ret = libxml2mod.xmlIsRef(self._o, elem__o, attr__o)
  4484.         return ret
  4485.  
  4486.     def removeID(self, attr):
  4487.         """Remove the given attribute from the ID table maintained
  4488.            internally. """
  4489.         if attr is None: attr__o = None
  4490.         else: attr__o = attr._o
  4491.         ret = libxml2mod.xmlRemoveID(self._o, attr__o)
  4492.         return ret
  4493.  
  4494.     def removeRef(self, attr):
  4495.         """Remove the given attribute from the Ref table maintained
  4496.            internally. """
  4497.         if attr is None: attr__o = None
  4498.         else: attr__o = attr._o
  4499.         ret = libxml2mod.xmlRemoveRef(self._o, attr__o)
  4500.         return ret
  4501.  
  4502.     def validCtxtNormalizeAttributeValue(self, ctxt, elem, name, value):
  4503.         """Does the validation related extra step of the normalization
  4504.           of attribute values:  If the declared value is not CDATA,
  4505.           then the XML processor must further process the normalized
  4506.           attribute value by discarding any leading and trailing
  4507.           space (#x20) characters, and by replacing sequences of
  4508.           space (#x20) characters by single space (#x20) character. 
  4509.           Also  check VC: Standalone Document Declaration in P32, and
  4510.            update ctxt->valid accordingly """
  4511.         if ctxt is None: ctxt__o = None
  4512.         else: ctxt__o = ctxt._o
  4513.         if elem is None: elem__o = None
  4514.         else: elem__o = elem._o
  4515.         ret = libxml2mod.xmlValidCtxtNormalizeAttributeValue(ctxt__o, self._o, elem__o, name, value)
  4516.         return ret
  4517.  
  4518.     def validNormalizeAttributeValue(self, elem, name, value):
  4519.         """Does the validation related extra step of the normalization
  4520.           of attribute values:  If the declared value is not CDATA,
  4521.           then the XML processor must further process the normalized
  4522.           attribute value by discarding any leading and trailing
  4523.           space (#x20) characters, and by replacing sequences of
  4524.            space (#x20) characters by single space (#x20) character. """
  4525.         if elem is None: elem__o = None
  4526.         else: elem__o = elem._o
  4527.         ret = libxml2mod.xmlValidNormalizeAttributeValue(self._o, elem__o, name, value)
  4528.         return ret
  4529.  
  4530.     def validateDocument(self, ctxt):
  4531.         """Try to validate the document instance  basically it does
  4532.           the all the checks described by the XML Rec i.e. validates
  4533.           the internal and external subset (if present) and validate
  4534.            the document tree. """
  4535.         if ctxt is None: ctxt__o = None
  4536.         else: ctxt__o = ctxt._o
  4537.         ret = libxml2mod.xmlValidateDocument(ctxt__o, self._o)
  4538.         return ret
  4539.  
  4540.     def validateDocumentFinal(self, ctxt):
  4541.         """Does the final step for the document validation once all
  4542.           the incremental validation steps have been completed 
  4543.           basically it does the following checks described by the XML
  4544.           Rec  Check all the IDREF/IDREFS attributes definition for
  4545.            validity """
  4546.         if ctxt is None: ctxt__o = None
  4547.         else: ctxt__o = ctxt._o
  4548.         ret = libxml2mod.xmlValidateDocumentFinal(ctxt__o, self._o)
  4549.         return ret
  4550.  
  4551.     def validateDtd(self, ctxt, dtd):
  4552.         """Try to validate the document against the dtd instance 
  4553.           Basically it does check all the definitions in the DtD.
  4554.           Note the the internal subset (if present) is de-coupled
  4555.           (i.e. not used), which could give problems if ID or IDREF
  4556.            is present. """
  4557.         if ctxt is None: ctxt__o = None
  4558.         else: ctxt__o = ctxt._o
  4559.         if dtd is None: dtd__o = None
  4560.         else: dtd__o = dtd._o
  4561.         ret = libxml2mod.xmlValidateDtd(ctxt__o, self._o, dtd__o)
  4562.         return ret
  4563.  
  4564.     def validateDtdFinal(self, ctxt):
  4565.         """Does the final step for the dtds validation once all the
  4566.           subsets have been parsed  basically it does the following
  4567.           checks described by the XML Rec - check that ENTITY and
  4568.           ENTITIES type attributes default or possible values matches
  4569.           one of the defined entities. - check that NOTATION type
  4570.           attributes default or possible values matches one of the
  4571.            defined notations. """
  4572.         if ctxt is None: ctxt__o = None
  4573.         else: ctxt__o = ctxt._o
  4574.         ret = libxml2mod.xmlValidateDtdFinal(ctxt__o, self._o)
  4575.         return ret
  4576.  
  4577.     def validateElement(self, ctxt, elem):
  4578.         """Try to validate the subtree under an element """
  4579.         if ctxt is None: ctxt__o = None
  4580.         else: ctxt__o = ctxt._o
  4581.         if elem is None: elem__o = None
  4582.         else: elem__o = elem._o
  4583.         ret = libxml2mod.xmlValidateElement(ctxt__o, self._o, elem__o)
  4584.         return ret
  4585.  
  4586.     def validateNotationUse(self, ctxt, notationName):
  4587.         """Validate that the given name match a notation declaration.
  4588.            - [ VC: Notation Declared ] """
  4589.         if ctxt is None: ctxt__o = None
  4590.         else: ctxt__o = ctxt._o
  4591.         ret = libxml2mod.xmlValidateNotationUse(ctxt__o, self._o, notationName)
  4592.         return ret
  4593.  
  4594.     def validateOneAttribute(self, ctxt, elem, attr, value):
  4595.         """Try to validate a single attribute for an element basically
  4596.           it does the following checks as described by the XML-1.0
  4597.           recommendation: - [ VC: Attribute Value Type ] - [ VC:
  4598.           Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC:
  4599.           Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: Entity
  4600.           Name ] - [ VC: Notation Attributes ]  The ID/IDREF
  4601.            uniqueness and matching are done separately """
  4602.         if ctxt is None: ctxt__o = None
  4603.         else: ctxt__o = ctxt._o
  4604.         if elem is None: elem__o = None
  4605.         else: elem__o = elem._o
  4606.         if attr is None: attr__o = None
  4607.         else: attr__o = attr._o
  4608.         ret = libxml2mod.xmlValidateOneAttribute(ctxt__o, self._o, elem__o, attr__o, value)
  4609.         return ret
  4610.  
  4611.     def validateOneElement(self, ctxt, elem):
  4612.         """Try to validate a single element and it's attributes,
  4613.           basically it does the following checks as described by the
  4614.           XML-1.0 recommendation: - [ VC: Element Valid ] - [ VC:
  4615.           Required Attribute ] Then call xmlValidateOneAttribute()
  4616.           for each attribute present.  The ID/IDREF checkings are
  4617.            done separately """
  4618.         if ctxt is None: ctxt__o = None
  4619.         else: ctxt__o = ctxt._o
  4620.         if elem is None: elem__o = None
  4621.         else: elem__o = elem._o
  4622.         ret = libxml2mod.xmlValidateOneElement(ctxt__o, self._o, elem__o)
  4623.         return ret
  4624.  
  4625.     def validateOneNamespace(self, ctxt, elem, prefix, ns, value):
  4626.         """Try to validate a single namespace declaration for an
  4627.           element basically it does the following checks as described
  4628.           by the XML-1.0 recommendation: - [ VC: Attribute Value Type
  4629.           ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] -
  4630.           [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC:
  4631.           Entity Name ] - [ VC: Notation Attributes ]  The ID/IDREF
  4632.            uniqueness and matching are done separately """
  4633.         if ctxt is None: ctxt__o = None
  4634.         else: ctxt__o = ctxt._o
  4635.         if elem is None: elem__o = None
  4636.         else: elem__o = elem._o
  4637.         if ns is None: ns__o = None
  4638.         else: ns__o = ns._o
  4639.         ret = libxml2mod.xmlValidateOneNamespace(ctxt__o, self._o, elem__o, prefix, ns__o, value)
  4640.         return ret
  4641.  
  4642.     def validatePopElement(self, ctxt, elem, qname):
  4643.         """Pop the element end from the validation stack. """
  4644.         if ctxt is None: ctxt__o = None
  4645.         else: ctxt__o = ctxt._o
  4646.         if elem is None: elem__o = None
  4647.         else: elem__o = elem._o
  4648.         ret = libxml2mod.xmlValidatePopElement(ctxt__o, self._o, elem__o, qname)
  4649.         return ret
  4650.  
  4651.     def validatePushElement(self, ctxt, elem, qname):
  4652.         """Push a new element start on the validation stack. """
  4653.         if ctxt is None: ctxt__o = None
  4654.         else: ctxt__o = ctxt._o
  4655.         if elem is None: elem__o = None
  4656.         else: elem__o = elem._o
  4657.         ret = libxml2mod.xmlValidatePushElement(ctxt__o, self._o, elem__o, qname)
  4658.         return ret
  4659.  
  4660.     def validateRoot(self, ctxt):
  4661.         """Try to validate a the root element basically it does the
  4662.           following check as described by the XML-1.0 recommendation:
  4663.           - [ VC: Root Element Type ] it doesn't try to recurse or
  4664.            apply other check to the element """
  4665.         if ctxt is None: ctxt__o = None
  4666.         else: ctxt__o = ctxt._o
  4667.         ret = libxml2mod.xmlValidateRoot(ctxt__o, self._o)
  4668.         return ret
  4669.  
  4670.     #
  4671.     # xmlDoc functions from module xinclude
  4672.     #
  4673.  
  4674.     def xincludeProcess(self):
  4675.         """Implement the XInclude substitution on the XML document @doc """
  4676.         ret = libxml2mod.xmlXIncludeProcess(self._o)
  4677.         return ret
  4678.  
  4679.     def xincludeProcessFlags(self, flags):
  4680.         """Implement the XInclude substitution on the XML document @doc """
  4681.         ret = libxml2mod.xmlXIncludeProcessFlags(self._o, flags)
  4682.         return ret
  4683.  
  4684.     #
  4685.     # xmlDoc functions from module xmlreader
  4686.     #
  4687.  
  4688.     def NewWalker(self, reader):
  4689.         """Setup an xmltextReader to parse a preparsed XML document.
  4690.            This reuses the existing @reader xmlTextReader. """
  4691.         if reader is None: reader__o = None
  4692.         else: reader__o = reader._o
  4693.         ret = libxml2mod.xmlReaderNewWalker(reader__o, self._o)
  4694.         return ret
  4695.  
  4696.     def readerWalker(self):
  4697.         """Create an xmltextReader for a preparsed document. """
  4698.         ret = libxml2mod.xmlReaderWalker(self._o)
  4699.         if ret is None:raise treeError('xmlReaderWalker() failed')
  4700.         __tmp = xmlTextReader(_obj=ret)
  4701.         return __tmp
  4702.  
  4703.     #
  4704.     # xmlDoc functions from module xmlschemas
  4705.     #
  4706.  
  4707.     def schemaNewDocParserCtxt(self):
  4708.         """Create an XML Schemas parse context for that document. NB.
  4709.            The document may be modified during the parsing process. """
  4710.         ret = libxml2mod.xmlSchemaNewDocParserCtxt(self._o)
  4711.         if ret is None:raise parserError('xmlSchemaNewDocParserCtxt() failed')
  4712.         __tmp = SchemaParserCtxt(_obj=ret)
  4713.         return __tmp
  4714.  
  4715.     def schemaValidateDoc(self, ctxt):
  4716.         if ctxt is None: ctxt__o = None
  4717.         else: ctxt__o = ctxt._o
  4718.         ret = libxml2mod.xmlSchemaValidateDoc(ctxt__o, self._o)
  4719.         return ret
  4720.  
  4721.     #
  4722.     # xmlDoc functions from module xpath
  4723.     #
  4724.  
  4725.     def xpathNewContext(self):
  4726.         """Create a new xmlXPathContext """
  4727.         ret = libxml2mod.xmlXPathNewContext(self._o)
  4728.         if ret is None:raise xpathError('xmlXPathNewContext() failed')
  4729.         __tmp = xpathContext(_obj=ret)
  4730.         return __tmp
  4731.  
  4732.     def xpathOrderDocElems(self):
  4733.         """Call this routine to speed up XPath computation on static
  4734.           documents. This stamps all the element nodes with the
  4735.           document order Like for line information, the order is kept
  4736.           in the element->content field, the value stored is actually
  4737.           - the node number (starting at -1) to be able to
  4738.            differentiate from line numbers. """
  4739.         ret = libxml2mod.xmlXPathOrderDocElems(self._o)
  4740.         return ret
  4741.  
  4742.     #
  4743.     # xmlDoc functions from module xpointer
  4744.     #
  4745.  
  4746.     def xpointerNewContext(self, here, origin):
  4747.         """Create a new XPointer context """
  4748.         if here is None: here__o = None
  4749.         else: here__o = here._o
  4750.         if origin is None: origin__o = None
  4751.         else: origin__o = origin._o
  4752.         ret = libxml2mod.xmlXPtrNewContext(self._o, here__o, origin__o)
  4753.         if ret is None:raise treeError('xmlXPtrNewContext() failed')
  4754.         __tmp = xpathContext(_obj=ret)
  4755.         return __tmp
  4756.  
  4757. class xmlAttr(xmlNode):
  4758.     def __init__(self, _obj=None):
  4759.         if type(_obj).__name__ != 'PyCObject':
  4760.             raise TypeError, 'xmlAttr needs a PyCObject argument'
  4761.         self._o = _obj
  4762.         xmlNode.__init__(self, _obj=_obj)
  4763.  
  4764.     def __repr__(self):
  4765.         return "<xmlAttr (%s) object at 0x%x>" % (self.name, long(pos_id (self)))
  4766.  
  4767.     #
  4768.     # xmlAttr functions from module debugXML
  4769.     #
  4770.  
  4771.     def debugDumpAttr(self, output, depth):
  4772.         """Dumps debug information for the attribute """
  4773.         libxml2mod.xmlDebugDumpAttr(output, self._o, depth)
  4774.  
  4775.     def debugDumpAttrList(self, output, depth):
  4776.         """Dumps debug information for the attribute list """
  4777.         libxml2mod.xmlDebugDumpAttrList(output, self._o, depth)
  4778.  
  4779.     #
  4780.     # xmlAttr functions from module tree
  4781.     #
  4782.  
  4783.     def copyProp(self, target):
  4784.         """Do a copy of the attribute. """
  4785.         if target is None: target__o = None
  4786.         else: target__o = target._o
  4787.         ret = libxml2mod.xmlCopyProp(target__o, self._o)
  4788.         if ret is None:raise treeError('xmlCopyProp() failed')
  4789.         __tmp = xmlAttr(_obj=ret)
  4790.         return __tmp
  4791.  
  4792.     def copyPropList(self, target):
  4793.         """Do a copy of an attribute list. """
  4794.         if target is None: target__o = None
  4795.         else: target__o = target._o
  4796.         ret = libxml2mod.xmlCopyPropList(target__o, self._o)
  4797.         if ret is None:raise treeError('xmlCopyPropList() failed')
  4798.         __tmp = xmlAttr(_obj=ret)
  4799.         return __tmp
  4800.  
  4801.     def freeProp(self):
  4802.         """Free one attribute, all the content is freed too """
  4803.         libxml2mod.xmlFreeProp(self._o)
  4804.  
  4805.     def freePropList(self):
  4806.         """Free a property and all its siblings, all the children are
  4807.            freed too. """
  4808.         libxml2mod.xmlFreePropList(self._o)
  4809.  
  4810.     def removeProp(self):
  4811.         """Unlink and free one attribute, all the content is freed too
  4812.            Note this doesn't work for namespace definition attributes """
  4813.         ret = libxml2mod.xmlRemoveProp(self._o)
  4814.         return ret
  4815.  
  4816.     #
  4817.     # xmlAttr functions from module valid
  4818.     #
  4819.  
  4820.     def removeID(self, doc):
  4821.         """Remove the given attribute from the ID table maintained
  4822.            internally. """
  4823.         if doc is None: doc__o = None
  4824.         else: doc__o = doc._o
  4825.         ret = libxml2mod.xmlRemoveID(doc__o, self._o)
  4826.         return ret
  4827.  
  4828.     def removeRef(self, doc):
  4829.         """Remove the given attribute from the Ref table maintained
  4830.            internally. """
  4831.         if doc is None: doc__o = None
  4832.         else: doc__o = doc._o
  4833.         ret = libxml2mod.xmlRemoveRef(doc__o, self._o)
  4834.         return ret
  4835.  
  4836. class xmlReg:
  4837.     def __init__(self, _obj=None):
  4838.         if _obj != None:self._o = _obj;return
  4839.         self._o = None
  4840.  
  4841.     def __del__(self):
  4842.         if self._o != None:
  4843.             libxml2mod.xmlRegFreeRegexp(self._o)
  4844.         self._o = None
  4845.  
  4846.     #
  4847.     # xmlReg functions from module xmlregexp
  4848.     #
  4849.  
  4850.     def regexpExec(self, content):
  4851.         """Check if the regular expression generates the value """
  4852.         ret = libxml2mod.xmlRegexpExec(self._o, content)
  4853.         return ret
  4854.  
  4855.     def regexpIsDeterminist(self):
  4856.         """Check if the regular expression is determinist """
  4857.         ret = libxml2mod.xmlRegexpIsDeterminist(self._o)
  4858.         return ret
  4859.  
  4860.     def regexpPrint(self, output):
  4861.         """Print the content of the compiled regular expression """
  4862.         libxml2mod.xmlRegexpPrint(output, self._o)
  4863.  
  4864. class relaxNgValidCtxt(relaxNgValidCtxtCore):
  4865.     def __init__(self, _obj=None):
  4866.         self.schema = None
  4867.         self._o = _obj
  4868.         relaxNgValidCtxtCore.__init__(self, _obj=_obj)
  4869.  
  4870.     def __del__(self):
  4871.         if self._o != None:
  4872.             libxml2mod.xmlRelaxNGFreeValidCtxt(self._o)
  4873.         self._o = None
  4874.  
  4875.     #
  4876.     # relaxNgValidCtxt functions from module relaxng
  4877.     #
  4878.  
  4879.     def relaxNGValidateDoc(self, doc):
  4880.         """Validate a document tree in memory. """
  4881.         if doc is None: doc__o = None
  4882.         else: doc__o = doc._o
  4883.         ret = libxml2mod.xmlRelaxNGValidateDoc(self._o, doc__o)
  4884.         return ret
  4885.  
  4886.     def relaxNGValidateFullElement(self, doc, elem):
  4887.         """Validate a full subtree when
  4888.           xmlRelaxNGValidatePushElement() returned 0 and the content
  4889.            of the node has been expanded. """
  4890.         if doc is None: doc__o = None
  4891.         else: doc__o = doc._o
  4892.         if elem is None: elem__o = None
  4893.         else: elem__o = elem._o
  4894.         ret = libxml2mod.xmlRelaxNGValidateFullElement(self._o, doc__o, elem__o)
  4895.         return ret
  4896.  
  4897.     def relaxNGValidatePopElement(self, doc, elem):
  4898.         """Pop the element end from the RelaxNG validation stack. """
  4899.         if doc is None: doc__o = None
  4900.         else: doc__o = doc._o
  4901.         if elem is None: elem__o = None
  4902.         else: elem__o = elem._o
  4903.         ret = libxml2mod.xmlRelaxNGValidatePopElement(self._o, doc__o, elem__o)
  4904.         return ret
  4905.  
  4906.     def relaxNGValidatePushCData(self, data, len):
  4907.         """check the CData parsed for validation in the current stack """
  4908.         ret = libxml2mod.xmlRelaxNGValidatePushCData(self._o, data, len)
  4909.         return ret
  4910.  
  4911.     def relaxNGValidatePushElement(self, doc, elem):
  4912.         """Push a new element start on the RelaxNG validation stack. """
  4913.         if doc is None: doc__o = None
  4914.         else: doc__o = doc._o
  4915.         if elem is None: elem__o = None
  4916.         else: elem__o = elem._o
  4917.         ret = libxml2mod.xmlRelaxNGValidatePushElement(self._o, doc__o, elem__o)
  4918.         return ret
  4919.  
  4920. class parserCtxt(parserCtxtCore):
  4921.     def __init__(self, _obj=None):
  4922.         self._o = _obj
  4923.         parserCtxtCore.__init__(self, _obj=_obj)
  4924.  
  4925.     def __del__(self):
  4926.         if self._o != None:
  4927.             libxml2mod.xmlFreeParserCtxt(self._o)
  4928.         self._o = None
  4929.  
  4930.     # accessors for parserCtxt
  4931.     def doc(self):
  4932.         """Get the document tree from a parser context. """
  4933.         ret = libxml2mod.xmlParserGetDoc(self._o)
  4934.         if ret is None:raise parserError('xmlParserGetDoc() failed')
  4935.         __tmp = xmlDoc(_obj=ret)
  4936.         return __tmp
  4937.  
  4938.     def isValid(self):
  4939.         """Get the validity information from a parser context. """
  4940.         ret = libxml2mod.xmlParserGetIsValid(self._o)
  4941.         return ret
  4942.  
  4943.     def lineNumbers(self, linenumbers):
  4944.         """Switch on the generation of line number for elements nodes. """
  4945.         libxml2mod.xmlParserSetLineNumbers(self._o, linenumbers)
  4946.  
  4947.     def loadSubset(self, loadsubset):
  4948.         """Switch the parser to load the DTD without validating. """
  4949.         libxml2mod.xmlParserSetLoadSubset(self._o, loadsubset)
  4950.  
  4951.     def pedantic(self, pedantic):
  4952.         """Switch the parser to be pedantic. """
  4953.         libxml2mod.xmlParserSetPedantic(self._o, pedantic)
  4954.  
  4955.     def replaceEntities(self, replaceEntities):
  4956.         """Switch the parser to replace entities. """
  4957.         libxml2mod.xmlParserSetReplaceEntities(self._o, replaceEntities)
  4958.  
  4959.     def validate(self, validate):
  4960.         """Switch the parser to validation mode. """
  4961.         libxml2mod.xmlParserSetValidate(self._o, validate)
  4962.  
  4963.     def wellFormed(self):
  4964.         """Get the well formed information from a parser context. """
  4965.         ret = libxml2mod.xmlParserGetWellFormed(self._o)
  4966.         return ret
  4967.  
  4968.     #
  4969.     # parserCtxt functions from module HTMLparser
  4970.     #
  4971.  
  4972.     def htmlCtxtReadDoc(self, cur, URL, encoding, options):
  4973.         """parse an XML in-memory document and build a tree. This
  4974.            reuses the existing @ctxt parser context """
  4975.         ret = libxml2mod.htmlCtxtReadDoc(self._o, cur, URL, encoding, options)
  4976.         if ret is None:raise treeError('htmlCtxtReadDoc() failed')
  4977.         __tmp = xmlDoc(_obj=ret)
  4978.         return __tmp
  4979.  
  4980.     def htmlCtxtReadFd(self, fd, URL, encoding, options):
  4981.         """parse an XML from a file descriptor and build a tree. This
  4982.            reuses the existing @ctxt parser context """
  4983.         ret = libxml2mod.htmlCtxtReadFd(self._o, fd, URL, encoding, options)
  4984.         if ret is None:raise treeError('htmlCtxtReadFd() failed')
  4985.         __tmp = xmlDoc(_obj=ret)
  4986.         return __tmp
  4987.  
  4988.     def htmlCtxtReadFile(self, filename, encoding, options):
  4989.         """parse an XML file from the filesystem or the network. This
  4990.            reuses the existing @ctxt parser context """
  4991.         ret = libxml2mod.htmlCtxtReadFile(self._o, filename, encoding, options)
  4992.         if ret is None:raise treeError('htmlCtxtReadFile() failed')
  4993.         __tmp = xmlDoc(_obj=ret)
  4994.         return __tmp
  4995.  
  4996.     def htmlCtxtReadMemory(self, buffer, size, URL, encoding, options):
  4997.         """parse an XML in-memory document and build a tree. This
  4998.            reuses the existing @ctxt parser context """
  4999.         ret = libxml2mod.htmlCtxtReadMemory(self._o, buffer, size, URL, encoding, options)
  5000.         if ret is None:raise treeError('htmlCtxtReadMemory() failed')
  5001.         __tmp = xmlDoc(_obj=ret)
  5002.         return __tmp
  5003.  
  5004.     def htmlCtxtReset(self):
  5005.         """Reset a parser context """
  5006.         libxml2mod.htmlCtxtReset(self._o)
  5007.  
  5008.     def htmlCtxtUseOptions(self, options):
  5009.         """Applies the options to the parser context """
  5010.         ret = libxml2mod.htmlCtxtUseOptions(self._o, options)
  5011.         return ret
  5012.  
  5013.     def htmlFreeParserCtxt(self):
  5014.         """Free all the memory used by a parser context. However the
  5015.            parsed document in ctxt->myDoc is not freed. """
  5016.         libxml2mod.htmlFreeParserCtxt(self._o)
  5017.  
  5018.     def htmlParseCharRef(self):
  5019.         """parse Reference declarations  [66] CharRef ::= '&#' [0-9]+
  5020.            ';' | '&#x' [0-9a-fA-F]+ ';' """
  5021.         ret = libxml2mod.htmlParseCharRef(self._o)
  5022.         return ret
  5023.  
  5024.     def htmlParseChunk(self, chunk, size, terminate):
  5025.         """Parse a Chunk of memory """
  5026.         ret = libxml2mod.htmlParseChunk(self._o, chunk, size, terminate)
  5027.         return ret
  5028.  
  5029.     def htmlParseDocument(self):
  5030.         """parse an HTML document (and build a tree if using the
  5031.            standard SAX interface). """
  5032.         ret = libxml2mod.htmlParseDocument(self._o)
  5033.         return ret
  5034.  
  5035.     def htmlParseElement(self):
  5036.         """parse an HTML element, this is highly recursive  [39]
  5037.           element ::= EmptyElemTag | STag content ETag  [41]
  5038.            Attribute ::= Name Eq AttValue """
  5039.         libxml2mod.htmlParseElement(self._o)
  5040.  
  5041.     #
  5042.     # parserCtxt functions from module parser
  5043.     #
  5044.  
  5045.     def byteConsumed(self):
  5046.         """This function provides the current index of the parser
  5047.           relative to the start of the current entity. This function
  5048.           is computed in bytes from the beginning starting at zero
  5049.           and finishing at the size in byte of the file if parsing a
  5050.           file. The function is of constant cost if the input is
  5051.            UTF-8 but can be costly if run on non-UTF-8 input. """
  5052.         ret = libxml2mod.xmlByteConsumed(self._o)
  5053.         return ret
  5054.  
  5055.     def clearParserCtxt(self):
  5056.         """Clear (release owned resources) and reinitialize a parser
  5057.            context """
  5058.         libxml2mod.xmlClearParserCtxt(self._o)
  5059.  
  5060.     def ctxtReadDoc(self, cur, URL, encoding, options):
  5061.         """parse an XML in-memory document and build a tree. This
  5062.            reuses the existing @ctxt parser context """
  5063.         ret = libxml2mod.xmlCtxtReadDoc(self._o, cur, URL, encoding, options)
  5064.         if ret is None:raise treeError('xmlCtxtReadDoc() failed')
  5065.         __tmp = xmlDoc(_obj=ret)
  5066.         return __tmp
  5067.  
  5068.     def ctxtReadFd(self, fd, URL, encoding, options):
  5069.         """parse an XML from a file descriptor and build a tree. This
  5070.           reuses the existing @ctxt parser context NOTE that the file
  5071.           descriptor will not be closed when the reader is closed or
  5072.            reset. """
  5073.         ret = libxml2mod.xmlCtxtReadFd(self._o, fd, URL, encoding, options)
  5074.         if ret is None:raise treeError('xmlCtxtReadFd() failed')
  5075.         __tmp = xmlDoc(_obj=ret)
  5076.         return __tmp
  5077.  
  5078.     def ctxtReadFile(self, filename, encoding, options):
  5079.         """parse an XML file from the filesystem or the network. This
  5080.            reuses the existing @ctxt parser context """
  5081.         ret = libxml2mod.xmlCtxtReadFile(self._o, filename, encoding, options)
  5082.         if ret is None:raise treeError('xmlCtxtReadFile() failed')
  5083.         __tmp = xmlDoc(_obj=ret)
  5084.         return __tmp
  5085.  
  5086.     def ctxtReadMemory(self, buffer, size, URL, encoding, options):
  5087.         """parse an XML in-memory document and build a tree. This
  5088.            reuses the existing @ctxt parser context """
  5089.         ret = libxml2mod.xmlCtxtReadMemory(self._o, buffer, size, URL, encoding, options)
  5090.         if ret is None:raise treeError('xmlCtxtReadMemory() failed')
  5091.         __tmp = xmlDoc(_obj=ret)
  5092.         return __tmp
  5093.  
  5094.     def ctxtReset(self):
  5095.         """Reset a parser context """
  5096.         libxml2mod.xmlCtxtReset(self._o)
  5097.  
  5098.     def ctxtResetPush(self, chunk, size, filename, encoding):
  5099.         """Reset a push parser context """
  5100.         ret = libxml2mod.xmlCtxtResetPush(self._o, chunk, size, filename, encoding)
  5101.         return ret
  5102.  
  5103.     def ctxtUseOptions(self, options):
  5104.         """Applies the options to the parser context """
  5105.         ret = libxml2mod.xmlCtxtUseOptions(self._o, options)
  5106.         return ret
  5107.  
  5108.     def initParserCtxt(self):
  5109.         """Initialize a parser context """
  5110.         ret = libxml2mod.xmlInitParserCtxt(self._o)
  5111.         return ret
  5112.  
  5113.     def parseChunk(self, chunk, size, terminate):
  5114.         """Parse a Chunk of memory """
  5115.         ret = libxml2mod.xmlParseChunk(self._o, chunk, size, terminate)
  5116.         return ret
  5117.  
  5118.     def parseDocument(self):
  5119.         """parse an XML document (and build a tree if using the
  5120.           standard SAX interface).  [1] document ::= prolog element
  5121.            Misc*  [22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)? """
  5122.         ret = libxml2mod.xmlParseDocument(self._o)
  5123.         return ret
  5124.  
  5125.     def parseExtParsedEnt(self):
  5126.         """parse a general parsed entity An external general parsed
  5127.           entity is well-formed if it matches the production labeled
  5128.            extParsedEnt.  [78] extParsedEnt ::= TextDecl? content """
  5129.         ret = libxml2mod.xmlParseExtParsedEnt(self._o)
  5130.         return ret
  5131.  
  5132.     def setupParserForBuffer(self, buffer, filename):
  5133.         """Setup the parser context to parse a new buffer; Clears any
  5134.           prior contents from the parser context. The buffer
  5135.           parameter must not be None, but the filename parameter can
  5136.            be """
  5137.         libxml2mod.xmlSetupParserForBuffer(self._o, buffer, filename)
  5138.  
  5139.     def stopParser(self):
  5140.         """Blocks further parser processing """
  5141.         libxml2mod.xmlStopParser(self._o)
  5142.  
  5143.     #
  5144.     # parserCtxt functions from module parserInternals
  5145.     #
  5146.  
  5147.     def decodeEntities(self, len, what, end, end2, end3):
  5148.         """This function is deprecated, we now always process entities
  5149.           content through xmlStringDecodeEntities  TODO: remove it in
  5150.           next major release.  [67] Reference ::= EntityRef | CharRef
  5151.             [69] PEReference ::= '%' Name ';' """
  5152.         ret = libxml2mod.xmlDecodeEntities(self._o, len, what, end, end2, end3)
  5153.         return ret
  5154.  
  5155.     def handleEntity(self, entity):
  5156.         """Default handling of defined entities, when should we define
  5157.           a new input stream ? When do we just handle that as a set
  5158.            of chars ?  OBSOLETE: to be removed at some point. """
  5159.         if entity is None: entity__o = None
  5160.         else: entity__o = entity._o
  5161.         libxml2mod.xmlHandleEntity(self._o, entity__o)
  5162.  
  5163.     def namespaceParseNCName(self):
  5164.         """parse an XML namespace name.  TODO: this seems not in use
  5165.           anymore, the namespace handling is done on top of the SAX
  5166.           interfaces, i.e. not on raw input.  [NS 3] NCName ::=
  5167.           (Letter | '_') (NCNameChar)*  [NS 4] NCNameChar ::= Letter
  5168.            | Digit | '.' | '-' | '_' | CombiningChar | Extender """
  5169.         ret = libxml2mod.xmlNamespaceParseNCName(self._o)
  5170.         return ret
  5171.  
  5172.     def namespaceParseNSDef(self):
  5173.         """parse a namespace prefix declaration  TODO: this seems not
  5174.           in use anymore, the namespace handling is done on top of
  5175.           the SAX interfaces, i.e. not on raw input.  [NS 1] NSDef
  5176.           ::= PrefixDef Eq SystemLiteral  [NS 2] PrefixDef ::=
  5177.            'xmlns' (':' NCName)? """
  5178.         ret = libxml2mod.xmlNamespaceParseNSDef(self._o)
  5179.         return ret
  5180.  
  5181.     def nextChar(self):
  5182.         """Skip to the next char input char. """
  5183.         libxml2mod.xmlNextChar(self._o)
  5184.  
  5185.     def parseAttValue(self):
  5186.         """parse a value for an attribute Note: the parser won't do
  5187.           substitution of entities here, this will be handled later
  5188.           in xmlStringGetNodeList  [10] AttValue ::= '"' ([^<&"] |
  5189.           Reference)* '"' | "'" ([^<&'] | Reference)* "'"  3.3.3
  5190.           Attribute-Value Normalization: Before the value of an
  5191.           attribute is passed to the application or checked for
  5192.           validity, the XML processor must normalize it as follows: -
  5193.           a character reference is processed by appending the
  5194.           referenced character to the attribute value - an entity
  5195.           reference is processed by recursively processing the
  5196.           replacement text of the entity - a whitespace character
  5197.           (#x20, #xD, #xA, #x9) is processed by appending #x20 to the
  5198.           normalized value, except that only a single #x20 is
  5199.           appended for a "#xD#xA" sequence that is part of an
  5200.           external parsed entity or the literal entity value of an
  5201.           internal parsed entity - other characters are processed by
  5202.           appending them to the normalized value If the declared
  5203.           value is not CDATA, then the XML processor must further
  5204.           process the normalized attribute value by discarding any
  5205.           leading and trailing space (#x20) characters, and by
  5206.           replacing sequences of space (#x20) characters by a single
  5207.           space (#x20) character. All attributes for which no
  5208.           declaration has been read should be treated by a
  5209.            non-validating parser as if declared CDATA. """
  5210.         ret = libxml2mod.xmlParseAttValue(self._o)
  5211.         return ret
  5212.  
  5213.     def parseAttributeListDecl(self):
  5214.         """: parse the Attribute list def for an element  [52]
  5215.           AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>'  [53]
  5216.            AttDef ::= S Name S AttType S DefaultDecl """
  5217.         libxml2mod.xmlParseAttributeListDecl(self._o)
  5218.  
  5219.     def parseCDSect(self):
  5220.         """Parse escaped pure raw content.  [18] CDSect ::= CDStart
  5221.           CData CDEnd  [19] CDStart ::= '<![CDATA['  [20] Data ::=
  5222.            (Char* - (Char* ']]>' Char*))  [21] CDEnd ::= ']]>' """
  5223.         libxml2mod.xmlParseCDSect(self._o)
  5224.  
  5225.     def parseCharData(self, cdata):
  5226.         """parse a CharData section. if we are within a CDATA section
  5227.           ']]>' marks an end of section.  The right angle bracket (>)
  5228.           may be represented using the string ">", and must, for
  5229.           compatibility, be escaped using ">" or a character
  5230.           reference when it appears in the string "]]>" in content,
  5231.           when that string is not marking the end of a CDATA section.
  5232.             [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*) """
  5233.         libxml2mod.xmlParseCharData(self._o, cdata)
  5234.  
  5235.     def parseCharRef(self):
  5236.         """parse Reference declarations  [66] CharRef ::= '&#' [0-9]+
  5237.           ';' | '&#x' [0-9a-fA-F]+ ';'  [ WFC: Legal Character ]
  5238.           Characters referred to using character references must
  5239.            match the production for Char. """
  5240.         ret = libxml2mod.xmlParseCharRef(self._o)
  5241.         return ret
  5242.  
  5243.     def parseComment(self):
  5244.         """Skip an XML (SGML) comment <!-- .... --> The spec says that
  5245.           "For compatibility, the string "--" (double-hyphen) must
  5246.           not occur within comments. "  [15] Comment ::= '<!--'
  5247.            ((Char - '-') | ('-' (Char - '-')))* '-->' """
  5248.         libxml2mod.xmlParseComment(self._o)
  5249.  
  5250.     def parseContent(self):
  5251.         """Parse a content:  [43] content ::= (element | CharData |
  5252.            Reference | CDSect | PI | Comment)* """
  5253.         libxml2mod.xmlParseContent(self._o)
  5254.  
  5255.     def parseDocTypeDecl(self):
  5256.         """parse a DOCTYPE declaration  [28] doctypedecl ::=
  5257.           '<!DOCTYPE' S Name (S ExternalID)? S? ('[' (markupdecl |
  5258.           PEReference | S)* ']' S?)? '>'  [ VC: Root Element Type ]
  5259.           The Name in the document type declaration must match the
  5260.            element type of the root element. """
  5261.         libxml2mod.xmlParseDocTypeDecl(self._o)
  5262.  
  5263.     def parseElement(self):
  5264.         """parse an XML element, this is highly recursive  [39]
  5265.           element ::= EmptyElemTag | STag content ETag  [ WFC:
  5266.           Element Type Match ] The Name in an element's end-tag must
  5267.            match the element type in the start-tag. """
  5268.         libxml2mod.xmlParseElement(self._o)
  5269.  
  5270.     def parseElementDecl(self):
  5271.         """parse an Element declaration.  [45] elementdecl ::=
  5272.           '<!ELEMENT' S Name S contentspec S? '>'  [ VC: Unique
  5273.           Element Type Declaration ] No element type may be declared
  5274.            more than once """
  5275.         ret = libxml2mod.xmlParseElementDecl(self._o)
  5276.         return ret
  5277.  
  5278.     def parseEncName(self):
  5279.         """parse the XML encoding name  [81] EncName ::= [A-Za-z]
  5280.            ([A-Za-z0-9._] | '-')* """
  5281.         ret = libxml2mod.xmlParseEncName(self._o)
  5282.         return ret
  5283.  
  5284.     def parseEncodingDecl(self):
  5285.         """parse the XML encoding declaration  [80] EncodingDecl ::= S
  5286.           'encoding' Eq ('"' EncName '"' |  "'" EncName "'")  this
  5287.            setups the conversion filters. """
  5288.         ret = libxml2mod.xmlParseEncodingDecl(self._o)
  5289.         return ret
  5290.  
  5291.     def parseEndTag(self):
  5292.         """parse an end of tag  [42] ETag ::= '</' Name S? '>'  With
  5293.            namespace  [NS 9] ETag ::= '</' QName S? '>' """
  5294.         libxml2mod.xmlParseEndTag(self._o)
  5295.  
  5296.     def parseEntityDecl(self):
  5297.         """parse <!ENTITY declarations  [70] EntityDecl ::= GEDecl |
  5298.           PEDecl  [71] GEDecl ::= '<!ENTITY' S Name S EntityDef S?
  5299.           '>'  [72] PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'
  5300.           [73] EntityDef ::= EntityValue | (ExternalID NDataDecl?) 
  5301.           [74] PEDef ::= EntityValue | ExternalID  [76] NDataDecl ::=
  5302.           S 'NDATA' S Name  [ VC: Notation Declared ] The Name must
  5303.            match the declared name of a notation. """
  5304.         libxml2mod.xmlParseEntityDecl(self._o)
  5305.  
  5306.     def parseEntityRef(self):
  5307.         """parse ENTITY references declarations  [68] EntityRef ::=
  5308.           '&' Name ';'  [ WFC: Entity Declared ] In a document
  5309.           without any DTD, a document with only an internal DTD
  5310.           subset which contains no parameter entity references, or a
  5311.           document with "standalone='yes'", the Name given in the
  5312.           entity reference must match that in an entity declaration,
  5313.           except that well-formed documents need not declare any of
  5314.           the following entities: amp, lt, gt, apos, quot.  The
  5315.           declaration of a parameter entity must precede any
  5316.           reference to it.  Similarly, the declaration of a general
  5317.           entity must precede any reference to it which appears in a
  5318.           default value in an attribute-list declaration. Note that
  5319.           if entities are declared in the external subset or in
  5320.           external parameter entities, a non-validating processor is
  5321.           not obligated to read and process their declarations; for
  5322.           such documents, the rule that an entity must be declared is
  5323.           a well-formedness constraint only if standalone='yes'.  [
  5324.           WFC: Parsed Entity ] An entity reference must not contain
  5325.            the name of an unparsed entity """
  5326.         ret = libxml2mod.xmlParseEntityRef(self._o)
  5327.         if ret is None:raise parserError('xmlParseEntityRef() failed')
  5328.         __tmp = xmlEntity(_obj=ret)
  5329.         return __tmp
  5330.  
  5331.     def parseExternalSubset(self, ExternalID, SystemID):
  5332.         """parse Markup declarations from an external subset  [30]
  5333.           extSubset ::= textDecl? extSubsetDecl  [31] extSubsetDecl
  5334.            ::= (markupdecl | conditionalSect | PEReference | S) * """
  5335.         libxml2mod.xmlParseExternalSubset(self._o, ExternalID, SystemID)
  5336.  
  5337.     def parseMarkupDecl(self):
  5338.         """parse Markup declarations  [29] markupdecl ::= elementdecl
  5339.           | AttlistDecl | EntityDecl | NotationDecl | PI | Comment  [
  5340.           VC: Proper Declaration/PE Nesting ] Parameter-entity
  5341.           replacement text must be properly nested with markup
  5342.           declarations. That is to say, if either the first character
  5343.           or the last character of a markup declaration (markupdecl
  5344.           above) is contained in the replacement text for a
  5345.           parameter-entity reference, both must be contained in the
  5346.           same replacement text.  [ WFC: PEs in Internal Subset ] In
  5347.           the internal DTD subset, parameter-entity references can
  5348.           occur only where markup declarations can occur, not within
  5349.           markup declarations. (This does not apply to references
  5350.           that occur in external parameter entities or to the
  5351.            external subset.) """
  5352.         libxml2mod.xmlParseMarkupDecl(self._o)
  5353.  
  5354.     def parseMisc(self):
  5355.         """parse an XML Misc* optional field.  [27] Misc ::= Comment |
  5356.            PI |  S """
  5357.         libxml2mod.xmlParseMisc(self._o)
  5358.  
  5359.     def parseName(self):
  5360.         """parse an XML name.  [4] NameChar ::= Letter | Digit | '.' |
  5361.           '-' | '_' | ':' | CombiningChar | Extender  [5] Name ::=
  5362.           (Letter | '_' | ':') (NameChar)*  [6] Names ::= Name (#x20
  5363.            Name)* """
  5364.         ret = libxml2mod.xmlParseName(self._o)
  5365.         return ret
  5366.  
  5367.     def parseNamespace(self):
  5368.         """xmlParseNamespace: parse specific PI '<?namespace ...'
  5369.           constructs.  This is what the older xml-name Working Draft
  5370.           specified, a bunch of other stuff may still rely on it, so
  5371.           support is still here as if it was declared on the root of
  5372.           the Tree:-(  TODO: remove from library  To be removed at
  5373.            next drop of binary compatibility """
  5374.         libxml2mod.xmlParseNamespace(self._o)
  5375.  
  5376.     def parseNmtoken(self):
  5377.         """parse an XML Nmtoken.  [7] Nmtoken ::= (NameChar)+  [8]
  5378.            Nmtokens ::= Nmtoken (#x20 Nmtoken)* """
  5379.         ret = libxml2mod.xmlParseNmtoken(self._o)
  5380.         return ret
  5381.  
  5382.     def parseNotationDecl(self):
  5383.         """parse a notation declaration  [82] NotationDecl ::=
  5384.           '<!NOTATION' S Name S (ExternalID |  PublicID) S? '>' 
  5385.           Hence there is actually 3 choices: 'PUBLIC' S PubidLiteral
  5386.           'PUBLIC' S PubidLiteral S SystemLiteral and 'SYSTEM' S
  5387.            SystemLiteral  See the NOTE on xmlParseExternalID(). """
  5388.         libxml2mod.xmlParseNotationDecl(self._o)
  5389.  
  5390.     def parsePEReference(self):
  5391.         """parse PEReference declarations The entity content is
  5392.           handled directly by pushing it's content as a new input
  5393.           stream.  [69] PEReference ::= '%' Name ';'  [ WFC: No
  5394.           Recursion ] A parsed entity must not contain a recursive
  5395.           reference to itself, either directly or indirectly.  [ WFC:
  5396.           Entity Declared ] In a document without any DTD, a document
  5397.           with only an internal DTD subset which contains no
  5398.           parameter entity references, or a document with
  5399.           "standalone='yes'", ...  ... The declaration of a parameter
  5400.           entity must precede any reference to it...  [ VC: Entity
  5401.           Declared ] In a document with an external subset or
  5402.           external parameter entities with "standalone='no'", ... 
  5403.           ... The declaration of a parameter entity must precede any
  5404.           reference to it...  [ WFC: In DTD ] Parameter-entity
  5405.           references may only appear in the DTD. NOTE: misleading but
  5406.            this is handled. """
  5407.         libxml2mod.xmlParsePEReference(self._o)
  5408.  
  5409.     def parsePI(self):
  5410.         """parse an XML Processing Instruction.  [16] PI ::= '<?'
  5411.           PITarget (S (Char* - (Char* '?>' Char*)))? '?>'  The
  5412.            processing is transfered to SAX once parsed. """
  5413.         libxml2mod.xmlParsePI(self._o)
  5414.  
  5415.     def parsePITarget(self):
  5416.         """parse the name of a PI  [17] PITarget ::= Name - (('X' |
  5417.            'x') ('M' | 'm') ('L' | 'l')) """
  5418.         ret = libxml2mod.xmlParsePITarget(self._o)
  5419.         return ret
  5420.  
  5421.     def parsePubidLiteral(self):
  5422.         """parse an XML public literal  [12] PubidLiteral ::= '"'
  5423.            PubidChar* '"' | "'" (PubidChar - "'")* "'" """
  5424.         ret = libxml2mod.xmlParsePubidLiteral(self._o)
  5425.         return ret
  5426.  
  5427.     def parseQuotedString(self):
  5428.         """Parse and return a string between quotes or doublequotes 
  5429.           TODO: Deprecated, to  be removed at next drop of binary
  5430.            compatibility """
  5431.         ret = libxml2mod.xmlParseQuotedString(self._o)
  5432.         return ret
  5433.  
  5434.     def parseReference(self):
  5435.         """parse and handle entity references in content, depending on
  5436.           the SAX interface, this may end-up in a call to character()
  5437.           if this is a CharRef, a predefined entity, if there is no
  5438.           reference() callback. or if the parser was asked to switch
  5439.            to that mode.  [67] Reference ::= EntityRef | CharRef """
  5440.         libxml2mod.xmlParseReference(self._o)
  5441.  
  5442.     def parseSDDecl(self):
  5443.         """parse the XML standalone declaration  [32] SDDecl ::= S
  5444.           'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' |
  5445.           'no')'"'))  [ VC: Standalone Document Declaration ] TODO
  5446.           The standalone document declaration must have the value
  5447.           "no" if any external markup declarations contain
  5448.           declarations of: - attributes with default values, if
  5449.           elements to which these attributes apply appear in the
  5450.           document without specifications of values for these
  5451.           attributes, or - entities (other than amp, lt, gt, apos,
  5452.           quot), if references to those entities appear in the
  5453.           document, or - attributes with values subject to
  5454.           normalization, where the attribute appears in the document
  5455.           with a value which will change as a result of
  5456.           normalization, or - element types with element content, if
  5457.           white space occurs directly within any instance of those
  5458.            types. """
  5459.         ret = libxml2mod.xmlParseSDDecl(self._o)
  5460.         return ret
  5461.  
  5462.     def parseStartTag(self):
  5463.         """parse a start of tag either for rule element or
  5464.           EmptyElement. In both case we don't parse the tag closing
  5465.           chars.  [40] STag ::= '<' Name (S Attribute)* S? '>'  [
  5466.           WFC: Unique Att Spec ] No attribute name may appear more
  5467.           than once in the same start-tag or empty-element tag.  [44]
  5468.           EmptyElemTag ::= '<' Name (S Attribute)* S? '/>'  [ WFC:
  5469.           Unique Att Spec ] No attribute name may appear more than
  5470.           once in the same start-tag or empty-element tag.  With
  5471.           namespace:  [NS 8] STag ::= '<' QName (S Attribute)* S? '>'
  5472.             [NS 10] EmptyElement ::= '<' QName (S Attribute)* S? '/>' """
  5473.         ret = libxml2mod.xmlParseStartTag(self._o)
  5474.         return ret
  5475.  
  5476.     def parseSystemLiteral(self):
  5477.         """parse an XML Literal  [11] SystemLiteral ::= ('"' [^"]*
  5478.            '"') | ("'" [^']* "'") """
  5479.         ret = libxml2mod.xmlParseSystemLiteral(self._o)
  5480.         return ret
  5481.  
  5482.     def parseTextDecl(self):
  5483.         """parse an XML declaration header for external entities  [77]
  5484.           TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>' 
  5485.           Question: Seems that EncodingDecl is mandatory ? Is that a
  5486.            typo ? """
  5487.         libxml2mod.xmlParseTextDecl(self._o)
  5488.  
  5489.     def parseVersionInfo(self):
  5490.         """parse the XML version.  [24] VersionInfo ::= S 'version' Eq
  5491.            (' VersionNum ' | " VersionNum ")  [25] Eq ::= S? '=' S? """
  5492.         ret = libxml2mod.xmlParseVersionInfo(self._o)
  5493.         return ret
  5494.  
  5495.     def parseVersionNum(self):
  5496.         """parse the XML version value.  [26] VersionNum ::=
  5497.            ([a-zA-Z0-9_.:] | '-')+ """
  5498.         ret = libxml2mod.xmlParseVersionNum(self._o)
  5499.         return ret
  5500.  
  5501.     def parseXMLDecl(self):
  5502.         """parse an XML declaration header  [23] XMLDecl ::= '<?xml'
  5503.            VersionInfo EncodingDecl? SDDecl? S? '?>' """
  5504.         libxml2mod.xmlParseXMLDecl(self._o)
  5505.  
  5506.     def parserHandlePEReference(self):
  5507.         """[69] PEReference ::= '%' Name ';'  [ WFC: No Recursion ] A
  5508.           parsed entity must not contain a recursive reference to
  5509.           itself, either directly or indirectly.  [ WFC: Entity
  5510.           Declared ] In a document without any DTD, a document with
  5511.           only an internal DTD subset which contains no parameter
  5512.           entity references, or a document with "standalone='yes'",
  5513.           ...  ... The declaration of a parameter entity must precede
  5514.           any reference to it...  [ VC: Entity Declared ] In a
  5515.           document with an external subset or external parameter
  5516.           entities with "standalone='no'", ...  ... The declaration
  5517.           of a parameter entity must precede any reference to it... 
  5518.           [ WFC: In DTD ] Parameter-entity references may only appear
  5519.           in the DTD. NOTE: misleading but this is handled.  A
  5520.           PEReference may have been detected in the current input
  5521.           stream the handling is done accordingly to
  5522.           http://www.w3.org/TR/REC-xml#entproc i.e. - Included in
  5523.           literal in entity values - Included as Parameter Entity
  5524.            reference within DTDs """
  5525.         libxml2mod.xmlParserHandlePEReference(self._o)
  5526.  
  5527.     def parserHandleReference(self):
  5528.         """TODO: Remove, now deprecated ... the test is done directly
  5529.           in the content parsing routines.  [67] Reference ::=
  5530.           EntityRef | CharRef  [68] EntityRef ::= '&' Name ';'  [
  5531.           WFC: Entity Declared ] the Name given in the entity
  5532.           reference must match that in an entity declaration, except
  5533.           that well-formed documents need not declare any of the
  5534.           following entities: amp, lt, gt, apos, quot.  [ WFC: Parsed
  5535.           Entity ] An entity reference must not contain the name of
  5536.           an unparsed entity  [66] CharRef ::= '&#' [0-9]+ ';' |
  5537.           '&#x' [0-9a-fA-F]+ ';'  A PEReference may have been
  5538.           detected in the current input stream the handling is done
  5539.            accordingly to http://www.w3.org/TR/REC-xml#entproc """
  5540.         libxml2mod.xmlParserHandleReference(self._o)
  5541.  
  5542.     def popInput(self):
  5543.         """xmlPopInput: the current input pointed by ctxt->input came
  5544.            to an end pop it and return the next char. """
  5545.         ret = libxml2mod.xmlPopInput(self._o)
  5546.         return ret
  5547.  
  5548.     def scanName(self):
  5549.         """Trickery: parse an XML name but without consuming the input
  5550.           flow Needed for rollback cases. Used only when parsing
  5551.           entities references.  TODO: seems deprecated now, only used
  5552.           in the default part of xmlParserHandleReference  [4]
  5553.           NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' |
  5554.           CombiningChar | Extender  [5] Name ::= (Letter | '_' | ':')
  5555.            (NameChar)*  [6] Names ::= Name (S Name)* """
  5556.         ret = libxml2mod.xmlScanName(self._o)
  5557.         return ret
  5558.  
  5559.     def skipBlankChars(self):
  5560.         """skip all blanks character found at that point in the input
  5561.           streams. It pops up finished entities in the process if
  5562.            allowable at that point. """
  5563.         ret = libxml2mod.xmlSkipBlankChars(self._o)
  5564.         return ret
  5565.  
  5566.     def stringDecodeEntities(self, str, what, end, end2, end3):
  5567.         """Takes a entity string content and process to do the
  5568.           adequate substitutions.  [67] Reference ::= EntityRef |
  5569.            CharRef  [69] PEReference ::= '%' Name ';' """
  5570.         ret = libxml2mod.xmlStringDecodeEntities(self._o, str, what, end, end2, end3)
  5571.         return ret
  5572.  
  5573.     def stringLenDecodeEntities(self, str, len, what, end, end2, end3):
  5574.         """Takes a entity string content and process to do the
  5575.           adequate substitutions.  [67] Reference ::= EntityRef |
  5576.            CharRef  [69] PEReference ::= '%' Name ';' """
  5577.         ret = libxml2mod.xmlStringLenDecodeEntities(self._o, str, len, what, end, end2, end3)
  5578.         return ret
  5579.  
  5580. class xmlDtd(xmlNode):
  5581.     def __init__(self, _obj=None):
  5582.         if type(_obj).__name__ != 'PyCObject':
  5583.             raise TypeError, 'xmlDtd needs a PyCObject argument'
  5584.         self._o = _obj
  5585.         xmlNode.__init__(self, _obj=_obj)
  5586.  
  5587.     def __repr__(self):
  5588.         return "<xmlDtd (%s) object at 0x%x>" % (self.name, long(pos_id (self)))
  5589.  
  5590.     #
  5591.     # xmlDtd functions from module debugXML
  5592.     #
  5593.  
  5594.     def debugDumpDTD(self, output):
  5595.         """Dumps debug information for the DTD """
  5596.         libxml2mod.xmlDebugDumpDTD(output, self._o)
  5597.  
  5598.     #
  5599.     # xmlDtd functions from module tree
  5600.     #
  5601.  
  5602.     def copyDtd(self):
  5603.         """Do a copy of the dtd. """
  5604.         ret = libxml2mod.xmlCopyDtd(self._o)
  5605.         if ret is None:raise treeError('xmlCopyDtd() failed')
  5606.         __tmp = xmlDtd(_obj=ret)
  5607.         return __tmp
  5608.  
  5609.     def freeDtd(self):
  5610.         """Free a DTD structure. """
  5611.         libxml2mod.xmlFreeDtd(self._o)
  5612.  
  5613.     #
  5614.     # xmlDtd functions from module valid
  5615.     #
  5616.  
  5617.     def dtdAttrDesc(self, elem, name):
  5618.         """Search the DTD for the description of this attribute on
  5619.            this element. """
  5620.         ret = libxml2mod.xmlGetDtdAttrDesc(self._o, elem, name)
  5621.         if ret is None:raise treeError('xmlGetDtdAttrDesc() failed')
  5622.         __tmp = xmlAttribute(_obj=ret)
  5623.         return __tmp
  5624.  
  5625.     def dtdElementDesc(self, name):
  5626.         """Search the DTD for the description of this element """
  5627.         ret = libxml2mod.xmlGetDtdElementDesc(self._o, name)
  5628.         if ret is None:raise treeError('xmlGetDtdElementDesc() failed')
  5629.         __tmp = xmlElement(_obj=ret)
  5630.         return __tmp
  5631.  
  5632.     def dtdQAttrDesc(self, elem, name, prefix):
  5633.         """Search the DTD for the description of this qualified
  5634.            attribute on this element. """
  5635.         ret = libxml2mod.xmlGetDtdQAttrDesc(self._o, elem, name, prefix)
  5636.         if ret is None:raise treeError('xmlGetDtdQAttrDesc() failed')
  5637.         __tmp = xmlAttribute(_obj=ret)
  5638.         return __tmp
  5639.  
  5640.     def dtdQElementDesc(self, name, prefix):
  5641.         """Search the DTD for the description of this element """
  5642.         ret = libxml2mod.xmlGetDtdQElementDesc(self._o, name, prefix)
  5643.         if ret is None:raise treeError('xmlGetDtdQElementDesc() failed')
  5644.         __tmp = xmlElement(_obj=ret)
  5645.         return __tmp
  5646.  
  5647. class relaxNgParserCtxt:
  5648.     def __init__(self, _obj=None):
  5649.         if _obj != None:self._o = _obj;return
  5650.         self._o = None
  5651.  
  5652.     def __del__(self):
  5653.         if self._o != None:
  5654.             libxml2mod.xmlRelaxNGFreeParserCtxt(self._o)
  5655.         self._o = None
  5656.  
  5657.     #
  5658.     # relaxNgParserCtxt functions from module relaxng
  5659.     #
  5660.  
  5661.     def relaxNGParse(self):
  5662.         """parse a schema definition resource and build an internal
  5663.            XML Shema struture which can be used to validate instances. """
  5664.         ret = libxml2mod.xmlRelaxNGParse(self._o)
  5665.         if ret is None:raise parserError('xmlRelaxNGParse() failed')
  5666.         __tmp = relaxNgSchema(_obj=ret)
  5667.         return __tmp
  5668.  
  5669.     def relaxParserSetFlag(self, flags):
  5670.         """Semi private function used to pass informations to a parser
  5671.            context which are a combination of xmlRelaxNGParserFlag . """
  5672.         ret = libxml2mod.xmlRelaxParserSetFlag(self._o, flags)
  5673.         return ret
  5674.  
  5675. class xpathParserContext:
  5676.     def __init__(self, _obj=None):
  5677.         if _obj != None:self._o = _obj;return
  5678.         self._o = None
  5679.  
  5680.     # accessors for xpathParserContext
  5681.     def context(self):
  5682.         """Get the xpathContext from an xpathParserContext """
  5683.         ret = libxml2mod.xmlXPathParserGetContext(self._o)
  5684.         if ret is None:raise xpathError('xmlXPathParserGetContext() failed')
  5685.         __tmp = xpathContext(_obj=ret)
  5686.         return __tmp
  5687.  
  5688.     #
  5689.     # xpathParserContext functions from module xpathInternals
  5690.     #
  5691.  
  5692.     def xpathAddValues(self):
  5693.         """Implement the add operation on XPath objects: The numeric
  5694.           operators convert their operands to numbers as if by
  5695.            calling the number function. """
  5696.         libxml2mod.xmlXPathAddValues(self._o)
  5697.  
  5698.     def xpathBooleanFunction(self, nargs):
  5699.         """Implement the boolean() XPath function boolean
  5700.           boolean(object) The boolean function converts its argument
  5701.           to a boolean as follows: - a number is true if and only if
  5702.           it is neither positive or negative zero nor NaN - a
  5703.           node-set is true if and only if it is non-empty - a string
  5704.            is true if and only if its length is non-zero """
  5705.         libxml2mod.xmlXPathBooleanFunction(self._o, nargs)
  5706.  
  5707.     def xpathCeilingFunction(self, nargs):
  5708.         """Implement the ceiling() XPath function number
  5709.           ceiling(number) The ceiling function returns the smallest
  5710.           (closest to negative infinity) number that is not less than
  5711.            the argument and that is an integer. """
  5712.         libxml2mod.xmlXPathCeilingFunction(self._o, nargs)
  5713.  
  5714.     def xpathCompareValues(self, inf, strict):
  5715.         """Implement the compare operation on XPath objects: @arg1 <
  5716.           @arg2    (1, 1, ... @arg1 <= @arg2   (1, 0, ... @arg1 >
  5717.           @arg2    (0, 1, ... @arg1 >= @arg2   (0, 0, ...  When
  5718.           neither object to be compared is a node-set and the
  5719.           operator is <=, <, >=, >, then the objects are compared by
  5720.           converted both objects to numbers and comparing the numbers
  5721.           according to IEEE 754. The < comparison will be true if and
  5722.           only if the first number is less than the second number.
  5723.           The <= comparison will be true if and only if the first
  5724.           number is less than or equal to the second number. The >
  5725.           comparison will be true if and only if the first number is
  5726.           greater than the second number. The >= comparison will be
  5727.           true if and only if the first number is greater than or
  5728.            equal to the second number. """
  5729.         ret = libxml2mod.xmlXPathCompareValues(self._o, inf, strict)
  5730.         return ret
  5731.  
  5732.     def xpathConcatFunction(self, nargs):
  5733.         """Implement the concat() XPath function string concat(string,
  5734.           string, string*) The concat function returns the
  5735.            concatenation of its arguments. """
  5736.         libxml2mod.xmlXPathConcatFunction(self._o, nargs)
  5737.  
  5738.     def xpathContainsFunction(self, nargs):
  5739.         """Implement the contains() XPath function boolean
  5740.           contains(string, string) The contains function returns true
  5741.           if the first argument string contains the second argument
  5742.            string, and otherwise returns false. """
  5743.         libxml2mod.xmlXPathContainsFunction(self._o, nargs)
  5744.  
  5745.     def xpathCountFunction(self, nargs):
  5746.         """Implement the count() XPath function number count(node-set) """
  5747.         libxml2mod.xmlXPathCountFunction(self._o, nargs)
  5748.  
  5749.     def xpathDivValues(self):
  5750.         """Implement the div operation on XPath objects @arg1 / @arg2:
  5751.           The numeric operators convert their operands to numbers as
  5752.            if by calling the number function. """
  5753.         libxml2mod.xmlXPathDivValues(self._o)
  5754.  
  5755.     def xpathEqualValues(self):
  5756.         """Implement the equal operation on XPath objects content:
  5757.            @arg1 == @arg2 """
  5758.         ret = libxml2mod.xmlXPathEqualValues(self._o)
  5759.         return ret
  5760.  
  5761.     def xpathErr(self, error):
  5762.         """Handle an XPath error """
  5763.         libxml2mod.xmlXPathErr(self._o, error)
  5764.  
  5765.     def xpathEvalExpr(self):
  5766.         """Parse and evaluate an XPath expression in the given
  5767.            context, then push the result on the context stack """
  5768.         libxml2mod.xmlXPathEvalExpr(self._o)
  5769.  
  5770.     def xpathFalseFunction(self, nargs):
  5771.         """Implement the false() XPath function boolean false() """
  5772.         libxml2mod.xmlXPathFalseFunction(self._o, nargs)
  5773.  
  5774.     def xpathFloorFunction(self, nargs):
  5775.         """Implement the floor() XPath function number floor(number)
  5776.           The floor function returns the largest (closest to positive
  5777.           infinity) number that is not greater than the argument and
  5778.            that is an integer. """
  5779.         libxml2mod.xmlXPathFloorFunction(self._o, nargs)
  5780.  
  5781.     def xpathFreeParserContext(self):
  5782.         """Free up an xmlXPathParserContext """
  5783.         libxml2mod.xmlXPathFreeParserContext(self._o)
  5784.  
  5785.     def xpathIdFunction(self, nargs):
  5786.         """Implement the id() XPath function node-set id(object) The
  5787.           id function selects elements by their unique ID (see [5.2.1
  5788.           Unique IDs]). When the argument to id is of type node-set,
  5789.           then the result is the union of the result of applying id
  5790.           to the string value of each of the nodes in the argument
  5791.           node-set. When the argument to id is of any other type, the
  5792.           argument is converted to a string as if by a call to the
  5793.           string function; the string is split into a
  5794.           whitespace-separated list of tokens (whitespace is any
  5795.           sequence of characters matching the production S); the
  5796.           result is a node-set containing the elements in the same
  5797.           document as the context node that have a unique ID equal to
  5798.            any of the tokens in the list. """
  5799.         libxml2mod.xmlXPathIdFunction(self._o, nargs)
  5800.  
  5801.     def xpathLangFunction(self, nargs):
  5802.         """Implement the lang() XPath function boolean lang(string)
  5803.           The lang function returns true or false depending on
  5804.           whether the language of the context node as specified by
  5805.           xml:lang attributes is the same as or is a sublanguage of
  5806.           the language specified by the argument string. The language
  5807.           of the context node is determined by the value of the
  5808.           xml:lang attribute on the context node, or, if the context
  5809.           node has no xml:lang attribute, by the value of the
  5810.           xml:lang attribute on the nearest ancestor of the context
  5811.           node that has an xml:lang attribute. If there is no such
  5812.            attribute, then lang """
  5813.         libxml2mod.xmlXPathLangFunction(self._o, nargs)
  5814.  
  5815.     def xpathLastFunction(self, nargs):
  5816.         """Implement the last() XPath function number last() The last
  5817.           function returns the number of nodes in the context node
  5818.            list. """
  5819.         libxml2mod.xmlXPathLastFunction(self._o, nargs)
  5820.  
  5821.     def xpathLocalNameFunction(self, nargs):
  5822.         """Implement the local-name() XPath function string
  5823.           local-name(node-set?) The local-name function returns a
  5824.           string containing the local part of the name of the node in
  5825.           the argument node-set that is first in document order. If
  5826.           the node-set is empty or the first node has no name, an
  5827.           empty string is returned. If the argument is omitted it
  5828.            defaults to the context node. """
  5829.         libxml2mod.xmlXPathLocalNameFunction(self._o, nargs)
  5830.  
  5831.     def xpathModValues(self):
  5832.         """Implement the mod operation on XPath objects: @arg1 / @arg2
  5833.           The numeric operators convert their operands to numbers as
  5834.            if by calling the number function. """
  5835.         libxml2mod.xmlXPathModValues(self._o)
  5836.  
  5837.     def xpathMultValues(self):
  5838.         """Implement the multiply operation on XPath objects: The
  5839.           numeric operators convert their operands to numbers as if
  5840.            by calling the number function. """
  5841.         libxml2mod.xmlXPathMultValues(self._o)
  5842.  
  5843.     def xpathNamespaceURIFunction(self, nargs):
  5844.         """Implement the namespace-uri() XPath function string
  5845.           namespace-uri(node-set?) The namespace-uri function returns
  5846.           a string containing the namespace URI of the expanded name
  5847.           of the node in the argument node-set that is first in
  5848.           document order. If the node-set is empty, the first node
  5849.           has no name, or the expanded name has no namespace URI, an
  5850.           empty string is returned. If the argument is omitted it
  5851.            defaults to the context node. """
  5852.         libxml2mod.xmlXPathNamespaceURIFunction(self._o, nargs)
  5853.  
  5854.     def xpathNextAncestor(self, cur):
  5855.         """Traversal function for the "ancestor" direction the
  5856.           ancestor axis contains the ancestors of the context node;
  5857.           the ancestors of the context node consist of the parent of
  5858.           context node and the parent's parent and so on; the nodes
  5859.           are ordered in reverse document order; thus the parent is
  5860.           the first node on the axis, and the parent's parent is the
  5861.            second node on the axis """
  5862.         if cur is None: cur__o = None
  5863.         else: cur__o = cur._o
  5864.         ret = libxml2mod.xmlXPathNextAncestor(self._o, cur__o)
  5865.         if ret is None:raise xpathError('xmlXPathNextAncestor() failed')
  5866.         __tmp = xmlNode(_obj=ret)
  5867.         return __tmp
  5868.  
  5869.     def xpathNextAncestorOrSelf(self, cur):
  5870.         """Traversal function for the "ancestor-or-self" direction he
  5871.           ancestor-or-self axis contains the context node and
  5872.           ancestors of the context node in reverse document order;
  5873.           thus the context node is the first node on the axis, and
  5874.           the context node's parent the second; parent here is
  5875.            defined the same as with the parent axis. """
  5876.         if cur is None: cur__o = None
  5877.         else: cur__o = cur._o
  5878.         ret = libxml2mod.xmlXPathNextAncestorOrSelf(self._o, cur__o)
  5879.         if ret is None:raise xpathError('xmlXPathNextAncestorOrSelf() failed')
  5880.         __tmp = xmlNode(_obj=ret)
  5881.         return __tmp
  5882.  
  5883.     def xpathNextAttribute(self, cur):
  5884.         """Traversal function for the "attribute" direction TODO:
  5885.            support DTD inherited default attributes """
  5886.         if cur is None: cur__o = None
  5887.         else: cur__o = cur._o
  5888.         ret = libxml2mod.xmlXPathNextAttribute(self._o, cur__o)
  5889.         if ret is None:raise xpathError('xmlXPathNextAttribute() failed')
  5890.         __tmp = xmlNode(_obj=ret)
  5891.         return __tmp
  5892.  
  5893.     def xpathNextChild(self, cur):
  5894.         """Traversal function for the "child" direction The child axis
  5895.           contains the children of the context node in document order. """
  5896.         if cur is None: cur__o = None
  5897.         else: cur__o = cur._o
  5898.         ret = libxml2mod.xmlXPathNextChild(self._o, cur__o)
  5899.         if ret is None:raise xpathError('xmlXPathNextChild() failed')
  5900.         __tmp = xmlNode(_obj=ret)
  5901.         return __tmp
  5902.  
  5903.     def xpathNextDescendant(self, cur):
  5904.         """Traversal function for the "descendant" direction the
  5905.           descendant axis contains the descendants of the context
  5906.           node in document order; a descendant is a child or a child
  5907.            of a child and so on. """
  5908.         if cur is None: cur__o = None
  5909.         else: cur__o = cur._o
  5910.         ret = libxml2mod.xmlXPathNextDescendant(self._o, cur__o)
  5911.         if ret is None:raise xpathError('xmlXPathNextDescendant() failed')
  5912.         __tmp = xmlNode(_obj=ret)
  5913.         return __tmp
  5914.  
  5915.     def xpathNextDescendantOrSelf(self, cur):
  5916.         """Traversal function for the "descendant-or-self" direction
  5917.           the descendant-or-self axis contains the context node and
  5918.           the descendants of the context node in document order; thus
  5919.           the context node is the first node on the axis, and the
  5920.           first child of the context node is the second node on the
  5921.            axis """
  5922.         if cur is None: cur__o = None
  5923.         else: cur__o = cur._o
  5924.         ret = libxml2mod.xmlXPathNextDescendantOrSelf(self._o, cur__o)
  5925.         if ret is None:raise xpathError('xmlXPathNextDescendantOrSelf() failed')
  5926.         __tmp = xmlNode(_obj=ret)
  5927.         return __tmp
  5928.  
  5929.     def xpathNextFollowing(self, cur):
  5930.         """Traversal function for the "following" direction The
  5931.           following axis contains all nodes in the same document as
  5932.           the context node that are after the context node in
  5933.           document order, excluding any descendants and excluding
  5934.           attribute nodes and namespace nodes; the nodes are ordered
  5935.            in document order """
  5936.         if cur is None: cur__o = None
  5937.         else: cur__o = cur._o
  5938.         ret = libxml2mod.xmlXPathNextFollowing(self._o, cur__o)
  5939.         if ret is None:raise xpathError('xmlXPathNextFollowing() failed')
  5940.         __tmp = xmlNode(_obj=ret)
  5941.         return __tmp
  5942.  
  5943.     def xpathNextFollowingSibling(self, cur):
  5944.         """Traversal function for the "following-sibling" direction
  5945.           The following-sibling axis contains the following siblings
  5946.            of the context node in document order. """
  5947.         if cur is None: cur__o = None
  5948.         else: cur__o = cur._o
  5949.         ret = libxml2mod.xmlXPathNextFollowingSibling(self._o, cur__o)
  5950.         if ret is None:raise xpathError('xmlXPathNextFollowingSibling() failed')
  5951.         __tmp = xmlNode(_obj=ret)
  5952.         return __tmp
  5953.  
  5954.     def xpathNextNamespace(self, cur):
  5955.         """Traversal function for the "namespace" direction the
  5956.           namespace axis contains the namespace nodes of the context
  5957.           node; the order of nodes on this axis is
  5958.           implementation-defined; the axis will be empty unless the
  5959.           context node is an element  We keep the XML namespace node
  5960.            at the end of the list. """
  5961.         if cur is None: cur__o = None
  5962.         else: cur__o = cur._o
  5963.         ret = libxml2mod.xmlXPathNextNamespace(self._o, cur__o)
  5964.         if ret is None:raise xpathError('xmlXPathNextNamespace() failed')
  5965.         __tmp = xmlNode(_obj=ret)
  5966.         return __tmp
  5967.  
  5968.     def xpathNextParent(self, cur):
  5969.         """Traversal function for the "parent" direction The parent
  5970.           axis contains the parent of the context node, if there is
  5971.            one. """
  5972.         if cur is None: cur__o = None
  5973.         else: cur__o = cur._o
  5974.         ret = libxml2mod.xmlXPathNextParent(self._o, cur__o)
  5975.         if ret is None:raise xpathError('xmlXPathNextParent() failed')
  5976.         __tmp = xmlNode(_obj=ret)
  5977.         return __tmp
  5978.  
  5979.     def xpathNextPreceding(self, cur):
  5980.         """Traversal function for the "preceding" direction the
  5981.           preceding axis contains all nodes in the same document as
  5982.           the context node that are before the context node in
  5983.           document order, excluding any ancestors and excluding
  5984.           attribute nodes and namespace nodes; the nodes are ordered
  5985.            in reverse document order """
  5986.         if cur is None: cur__o = None
  5987.         else: cur__o = cur._o
  5988.         ret = libxml2mod.xmlXPathNextPreceding(self._o, cur__o)
  5989.         if ret is None:raise xpathError('xmlXPathNextPreceding() failed')
  5990.         __tmp = xmlNode(_obj=ret)
  5991.         return __tmp
  5992.  
  5993.     def xpathNextPrecedingSibling(self, cur):
  5994.         """Traversal function for the "preceding-sibling" direction
  5995.           The preceding-sibling axis contains the preceding siblings
  5996.           of the context node in reverse document order; the first
  5997.           preceding sibling is first on the axis; the sibling
  5998.            preceding that node is the second on the axis and so on. """
  5999.         if cur is None: cur__o = None
  6000.         else: cur__o = cur._o
  6001.         ret = libxml2mod.xmlXPathNextPrecedingSibling(self._o, cur__o)
  6002.         if ret is None:raise xpathError('xmlXPathNextPrecedingSibling() failed')
  6003.         __tmp = xmlNode(_obj=ret)
  6004.         return __tmp
  6005.  
  6006.     def xpathNextSelf(self, cur):
  6007.         """Traversal function for the "self" direction The self axis
  6008.            contains just the context node itself """
  6009.         if cur is None: cur__o = None
  6010.         else: cur__o = cur._o
  6011.         ret = libxml2mod.xmlXPathNextSelf(self._o, cur__o)
  6012.         if ret is None:raise xpathError('xmlXPathNextSelf() failed')
  6013.         __tmp = xmlNode(_obj=ret)
  6014.         return __tmp
  6015.  
  6016.     def xpathNormalizeFunction(self, nargs):
  6017.         """Implement the normalize-space() XPath function string
  6018.           normalize-space(string?) The normalize-space function
  6019.           returns the argument string with white space normalized by
  6020.           stripping leading and trailing whitespace and replacing
  6021.           sequences of whitespace characters by a single space.
  6022.           Whitespace characters are the same allowed by the S
  6023.           production in XML. If the argument is omitted, it defaults
  6024.           to the context node converted to a string, in other words
  6025.            the value of the context node. """
  6026.         libxml2mod.xmlXPathNormalizeFunction(self._o, nargs)
  6027.  
  6028.     def xpathNotEqualValues(self):
  6029.         """Implement the equal operation on XPath objects content:
  6030.            @arg1 == @arg2 """
  6031.         ret = libxml2mod.xmlXPathNotEqualValues(self._o)
  6032.         return ret
  6033.  
  6034.     def xpathNotFunction(self, nargs):
  6035.         """Implement the not() XPath function boolean not(boolean) The
  6036.           not function returns true if its argument is false, and
  6037.            false otherwise. """
  6038.         libxml2mod.xmlXPathNotFunction(self._o, nargs)
  6039.  
  6040.     def xpathNumberFunction(self, nargs):
  6041.         """Implement the number() XPath function number number(object?) """
  6042.         libxml2mod.xmlXPathNumberFunction(self._o, nargs)
  6043.  
  6044.     def xpathParseNCName(self):
  6045.         """parse an XML namespace non qualified name.  [NS 3] NCName
  6046.           ::= (Letter | '_') (NCNameChar)*  [NS 4] NCNameChar ::=
  6047.            Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender """
  6048.         ret = libxml2mod.xmlXPathParseNCName(self._o)
  6049.         return ret
  6050.  
  6051.     def xpathParseName(self):
  6052.         """parse an XML name  [4] NameChar ::= Letter | Digit | '.' |
  6053.           '-' | '_' | ':' | CombiningChar | Extender  [5] Name ::=
  6054.            (Letter | '_' | ':') (NameChar)* """
  6055.         ret = libxml2mod.xmlXPathParseName(self._o)
  6056.         return ret
  6057.  
  6058.     def xpathPopBoolean(self):
  6059.         """Pops a boolean from the stack, handling conversion if
  6060.            needed. Check error with #xmlXPathCheckError. """
  6061.         ret = libxml2mod.xmlXPathPopBoolean(self._o)
  6062.         return ret
  6063.  
  6064.     def xpathPopNumber(self):
  6065.         """Pops a number from the stack, handling conversion if
  6066.            needed. Check error with #xmlXPathCheckError. """
  6067.         ret = libxml2mod.xmlXPathPopNumber(self._o)
  6068.         return ret
  6069.  
  6070.     def xpathPopString(self):
  6071.         """Pops a string from the stack, handling conversion if
  6072.            needed. Check error with #xmlXPathCheckError. """
  6073.         ret = libxml2mod.xmlXPathPopString(self._o)
  6074.         return ret
  6075.  
  6076.     def xpathPositionFunction(self, nargs):
  6077.         """Implement the position() XPath function number position()
  6078.           The position function returns the position of the context
  6079.           node in the context node list. The first position is 1, and
  6080.            so the last position will be equal to last(). """
  6081.         libxml2mod.xmlXPathPositionFunction(self._o, nargs)
  6082.  
  6083.     def xpathRoot(self):
  6084.         """Initialize the context to the root of the document """
  6085.         libxml2mod.xmlXPathRoot(self._o)
  6086.  
  6087.     def xpathRoundFunction(self, nargs):
  6088.         """Implement the round() XPath function number round(number)
  6089.           The round function returns the number that is closest to
  6090.           the argument and that is an integer. If there are two such
  6091.            numbers, then the one that is even is returned. """
  6092.         libxml2mod.xmlXPathRoundFunction(self._o, nargs)
  6093.  
  6094.     def xpathStartsWithFunction(self, nargs):
  6095.         """Implement the starts-with() XPath function boolean
  6096.           starts-with(string, string) The starts-with function
  6097.           returns true if the first argument string starts with the
  6098.            second argument string, and otherwise returns false. """
  6099.         libxml2mod.xmlXPathStartsWithFunction(self._o, nargs)
  6100.  
  6101.     def xpathStringFunction(self, nargs):
  6102.         """Implement the string() XPath function string
  6103.           string(object?) The string function converts an object to a
  6104.           string as follows: - A node-set is converted to a string by
  6105.           returning the value of the node in the node-set that is
  6106.           first in document order. If the node-set is empty, an empty
  6107.           string is returned. - A number is converted to a string as
  6108.           follows + NaN is converted to the string NaN + positive
  6109.           zero is converted to the string 0 + negative zero is
  6110.           converted to the string 0 + positive infinity is converted
  6111.           to the string Infinity + negative infinity is converted to
  6112.           the string -Infinity + if the number is an integer, the
  6113.           number is represented in decimal form as a Number with no
  6114.           decimal point and no leading zeros, preceded by a minus
  6115.           sign (-) if the number is negative + otherwise, the number
  6116.           is represented in decimal form as a Number including a
  6117.           decimal point with at least one digit before the decimal
  6118.           point and at least one digit after the decimal point,
  6119.           preceded by a minus sign (-) if the number is negative;
  6120.           there must be no leading zeros before the decimal point
  6121.           apart possibly from the one required digit immediately
  6122.           before the decimal point; beyond the one required digit
  6123.           after the decimal point there must be as many, but only as
  6124.           many, more digits as are needed to uniquely distinguish the
  6125.           number from all other IEEE 754 numeric values. - The
  6126.           boolean false value is converted to the string false. The
  6127.           boolean true value is converted to the string true.  If the
  6128.           argument is omitted, it defaults to a node-set with the
  6129.            context node as its only member. """
  6130.         libxml2mod.xmlXPathStringFunction(self._o, nargs)
  6131.  
  6132.     def xpathStringLengthFunction(self, nargs):
  6133.         """Implement the string-length() XPath function number
  6134.           string-length(string?) The string-length returns the number
  6135.           of characters in the string (see [3.6 Strings]). If the
  6136.           argument is omitted, it defaults to the context node
  6137.           converted to a string, in other words the value of the
  6138.            context node. """
  6139.         libxml2mod.xmlXPathStringLengthFunction(self._o, nargs)
  6140.  
  6141.     def xpathSubValues(self):
  6142.         """Implement the subtraction operation on XPath objects: The
  6143.           numeric operators convert their operands to numbers as if
  6144.            by calling the number function. """
  6145.         libxml2mod.xmlXPathSubValues(self._o)
  6146.  
  6147.     def xpathSubstringAfterFunction(self, nargs):
  6148.         """Implement the substring-after() XPath function string
  6149.           substring-after(string, string) The substring-after
  6150.           function returns the substring of the first argument string
  6151.           that follows the first occurrence of the second argument
  6152.           string in the first argument string, or the empty stringi
  6153.           if the first argument string does not contain the second
  6154.           argument string. For example,
  6155.           substring-after("1999/04/01","/") returns 04/01, and
  6156.            substring-after("1999/04/01","19") returns 99/04/01. """
  6157.         libxml2mod.xmlXPathSubstringAfterFunction(self._o, nargs)
  6158.  
  6159.     def xpathSubstringBeforeFunction(self, nargs):
  6160.         """Implement the substring-before() XPath function string
  6161.           substring-before(string, string) The substring-before
  6162.           function returns the substring of the first argument string
  6163.           that precedes the first occurrence of the second argument
  6164.           string in the first argument string, or the empty string if
  6165.           the first argument string does not contain the second
  6166.           argument string. For example,
  6167.            substring-before("1999/04/01","/") returns 1999. """
  6168.         libxml2mod.xmlXPathSubstringBeforeFunction(self._o, nargs)
  6169.  
  6170.     def xpathSubstringFunction(self, nargs):
  6171.         """Implement the substring() XPath function string
  6172.           substring(string, number, number?) The substring function
  6173.           returns the substring of the first argument starting at the
  6174.           position specified in the second argument with length
  6175.           specified in the third argument. For example,
  6176.           substring("12345",2,3) returns "234". If the third argument
  6177.           is not specified, it returns the substring starting at the
  6178.           position specified in the second argument and continuing to
  6179.           the end of the string. For example, substring("12345",2)
  6180.           returns "2345".  More precisely, each character in the
  6181.           string (see [3.6 Strings]) is considered to have a numeric
  6182.           position: the position of the first character is 1, the
  6183.           position of the second character is 2 and so on. The
  6184.           returned substring contains those characters for which the
  6185.           position of the character is greater than or equal to the
  6186.           second argument and, if the third argument is specified,
  6187.           less than the sum of the second and third arguments; the
  6188.           comparisons and addition used for the above follow the
  6189.           standard IEEE 754 rules. Thus: - substring("12345", 1.5,
  6190.           2.6) returns "234" - substring("12345", 0, 3) returns "12"
  6191.           - substring("12345", 0 div 0, 3) returns "" -
  6192.           substring("12345", 1, 0 div 0) returns "" -
  6193.           substring("12345", -42, 1 div 0) returns "12345" -
  6194.            substring("12345", -1 div 0, 1 div 0) returns "" """
  6195.         libxml2mod.xmlXPathSubstringFunction(self._o, nargs)
  6196.  
  6197.     def xpathSumFunction(self, nargs):
  6198.         """Implement the sum() XPath function number sum(node-set) The
  6199.           sum function returns the sum of the values of the nodes in
  6200.            the argument node-set. """
  6201.         libxml2mod.xmlXPathSumFunction(self._o, nargs)
  6202.  
  6203.     def xpathTranslateFunction(self, nargs):
  6204.         """Implement the translate() XPath function string
  6205.           translate(string, string, string) The translate function
  6206.           returns the first argument string with occurrences of
  6207.           characters in the second argument string replaced by the
  6208.           character at the corresponding position in the third
  6209.           argument string. For example, translate("bar","abc","ABC")
  6210.           returns the string BAr. If there is a character in the
  6211.           second argument string with no character at a corresponding
  6212.           position in the third argument string (because the second
  6213.           argument string is longer than the third argument string),
  6214.           then occurrences of that character in the first argument
  6215.           string are removed. For example,
  6216.            translate("--aaa--","abc-","ABC") """
  6217.         libxml2mod.xmlXPathTranslateFunction(self._o, nargs)
  6218.  
  6219.     def xpathTrueFunction(self, nargs):
  6220.         """Implement the true() XPath function boolean true() """
  6221.         libxml2mod.xmlXPathTrueFunction(self._o, nargs)
  6222.  
  6223.     def xpathValueFlipSign(self):
  6224.         """Implement the unary - operation on an XPath object The
  6225.           numeric operators convert their operands to numbers as if
  6226.            by calling the number function. """
  6227.         libxml2mod.xmlXPathValueFlipSign(self._o)
  6228.  
  6229.     def xpatherror(self, file, line, no):
  6230.         """Formats an error message. """
  6231.         libxml2mod.xmlXPatherror(self._o, file, line, no)
  6232.  
  6233.     #
  6234.     # xpathParserContext functions from module xpointer
  6235.     #
  6236.  
  6237.     def xpointerEvalRangePredicate(self):
  6238.         """[8]   Predicate ::=   '[' PredicateExpr ']' [9]  
  6239.           PredicateExpr ::=   Expr  Evaluate a predicate as in
  6240.           xmlXPathEvalPredicate() but for a Location Set instead of a
  6241.            node set """
  6242.         libxml2mod.xmlXPtrEvalRangePredicate(self._o)
  6243.  
  6244.     def xpointerRangeToFunction(self, nargs):
  6245.         """Implement the range-to() XPointer function """
  6246.         libxml2mod.xmlXPtrRangeToFunction(self._o, nargs)
  6247.  
  6248. class SchemaParserCtxt:
  6249.     def __init__(self, _obj=None):
  6250.         if _obj != None:self._o = _obj;return
  6251.         self._o = None
  6252.  
  6253.     def __del__(self):
  6254.         if self._o != None:
  6255.             libxml2mod.xmlSchemaFreeParserCtxt(self._o)
  6256.         self._o = None
  6257.  
  6258.     #
  6259.     # SchemaParserCtxt functions from module xmlschemas
  6260.     #
  6261.  
  6262.     def schemaParse(self):
  6263.         """parse a schema definition resource and build an internal
  6264.            XML Shema struture which can be used to validate instances. """
  6265.         ret = libxml2mod.xmlSchemaParse(self._o)
  6266.         if ret is None:raise parserError('xmlSchemaParse() failed')
  6267.         __tmp = Schema(_obj=ret)
  6268.         return __tmp
  6269.  
  6270. class ValidCtxt(ValidCtxtCore):
  6271.     def __init__(self, _obj=None):
  6272.         self._o = _obj
  6273.         ValidCtxtCore.__init__(self, _obj=_obj)
  6274.  
  6275.     def __del__(self):
  6276.         if self._o != None:
  6277.             libxml2mod.xmlFreeValidCtxt(self._o)
  6278.         self._o = None
  6279.  
  6280.     #
  6281.     # ValidCtxt functions from module valid
  6282.     #
  6283.  
  6284.     def validCtxtNormalizeAttributeValue(self, doc, elem, name, value):
  6285.         """Does the validation related extra step of the normalization
  6286.           of attribute values:  If the declared value is not CDATA,
  6287.           then the XML processor must further process the normalized
  6288.           attribute value by discarding any leading and trailing
  6289.           space (#x20) characters, and by replacing sequences of
  6290.           space (#x20) characters by single space (#x20) character. 
  6291.           Also  check VC: Standalone Document Declaration in P32, and
  6292.            update ctxt->valid accordingly """
  6293.         if doc is None: doc__o = None
  6294.         else: doc__o = doc._o
  6295.         if elem is None: elem__o = None
  6296.         else: elem__o = elem._o
  6297.         ret = libxml2mod.xmlValidCtxtNormalizeAttributeValue(self._o, doc__o, elem__o, name, value)
  6298.         return ret
  6299.  
  6300.     def validateDocument(self, doc):
  6301.         """Try to validate the document instance  basically it does
  6302.           the all the checks described by the XML Rec i.e. validates
  6303.           the internal and external subset (if present) and validate
  6304.            the document tree. """
  6305.         if doc is None: doc__o = None
  6306.         else: doc__o = doc._o
  6307.         ret = libxml2mod.xmlValidateDocument(self._o, doc__o)
  6308.         return ret
  6309.  
  6310.     def validateDocumentFinal(self, doc):
  6311.         """Does the final step for the document validation once all
  6312.           the incremental validation steps have been completed 
  6313.           basically it does the following checks described by the XML
  6314.           Rec  Check all the IDREF/IDREFS attributes definition for
  6315.            validity """
  6316.         if doc is None: doc__o = None
  6317.         else: doc__o = doc._o
  6318.         ret = libxml2mod.xmlValidateDocumentFinal(self._o, doc__o)
  6319.         return ret
  6320.  
  6321.     def validateDtd(self, doc, dtd):
  6322.         """Try to validate the document against the dtd instance 
  6323.           Basically it does check all the definitions in the DtD.
  6324.           Note the the internal subset (if present) is de-coupled
  6325.           (i.e. not used), which could give problems if ID or IDREF
  6326.            is present. """
  6327.         if doc is None: doc__o = None
  6328.         else: doc__o = doc._o
  6329.         if dtd is None: dtd__o = None
  6330.         else: dtd__o = dtd._o
  6331.         ret = libxml2mod.xmlValidateDtd(self._o, doc__o, dtd__o)
  6332.         return ret
  6333.  
  6334.     def validateDtdFinal(self, doc):
  6335.         """Does the final step for the dtds validation once all the
  6336.           subsets have been parsed  basically it does the following
  6337.           checks described by the XML Rec - check that ENTITY and
  6338.           ENTITIES type attributes default or possible values matches
  6339.           one of the defined entities. - check that NOTATION type
  6340.           attributes default or possible values matches one of the
  6341.            defined notations. """
  6342.         if doc is None: doc__o = None
  6343.         else: doc__o = doc._o
  6344.         ret = libxml2mod.xmlValidateDtdFinal(self._o, doc__o)
  6345.         return ret
  6346.  
  6347.     def validateElement(self, doc, elem):
  6348.         """Try to validate the subtree under an element """
  6349.         if doc is None: doc__o = None
  6350.         else: doc__o = doc._o
  6351.         if elem is None: elem__o = None
  6352.         else: elem__o = elem._o
  6353.         ret = libxml2mod.xmlValidateElement(self._o, doc__o, elem__o)
  6354.         return ret
  6355.  
  6356.     def validateNotationUse(self, doc, notationName):
  6357.         """Validate that the given name match a notation declaration.
  6358.            - [ VC: Notation Declared ] """
  6359.         if doc is None: doc__o = None
  6360.         else: doc__o = doc._o
  6361.         ret = libxml2mod.xmlValidateNotationUse(self._o, doc__o, notationName)
  6362.         return ret
  6363.  
  6364.     def validateOneAttribute(self, doc, elem, attr, value):
  6365.         """Try to validate a single attribute for an element basically
  6366.           it does the following checks as described by the XML-1.0
  6367.           recommendation: - [ VC: Attribute Value Type ] - [ VC:
  6368.           Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC:
  6369.           Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: Entity
  6370.           Name ] - [ VC: Notation Attributes ]  The ID/IDREF
  6371.            uniqueness and matching are done separately """
  6372.         if doc is None: doc__o = None
  6373.         else: doc__o = doc._o
  6374.         if elem is None: elem__o = None
  6375.         else: elem__o = elem._o
  6376.         if attr is None: attr__o = None
  6377.         else: attr__o = attr._o
  6378.         ret = libxml2mod.xmlValidateOneAttribute(self._o, doc__o, elem__o, attr__o, value)
  6379.         return ret
  6380.  
  6381.     def validateOneElement(self, doc, elem):
  6382.         """Try to validate a single element and it's attributes,
  6383.           basically it does the following checks as described by the
  6384.           XML-1.0 recommendation: - [ VC: Element Valid ] - [ VC:
  6385.           Required Attribute ] Then call xmlValidateOneAttribute()
  6386.           for each attribute present.  The ID/IDREF checkings are
  6387.            done separately """
  6388.         if doc is None: doc__o = None
  6389.         else: doc__o = doc._o
  6390.         if elem is None: elem__o = None
  6391.         else: elem__o = elem._o
  6392.         ret = libxml2mod.xmlValidateOneElement(self._o, doc__o, elem__o)
  6393.         return ret
  6394.  
  6395.     def validateOneNamespace(self, doc, elem, prefix, ns, value):
  6396.         """Try to validate a single namespace declaration for an
  6397.           element basically it does the following checks as described
  6398.           by the XML-1.0 recommendation: - [ VC: Attribute Value Type
  6399.           ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] -
  6400.           [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC:
  6401.           Entity Name ] - [ VC: Notation Attributes ]  The ID/IDREF
  6402.            uniqueness and matching are done separately """
  6403.         if doc is None: doc__o = None
  6404.         else: doc__o = doc._o
  6405.         if elem is None: elem__o = None
  6406.         else: elem__o = elem._o
  6407.         if ns is None: ns__o = None
  6408.         else: ns__o = ns._o
  6409.         ret = libxml2mod.xmlValidateOneNamespace(self._o, doc__o, elem__o, prefix, ns__o, value)
  6410.         return ret
  6411.  
  6412.     def validatePopElement(self, doc, elem, qname):
  6413.         """Pop the element end from the validation stack. """
  6414.         if doc is None: doc__o = None
  6415.         else: doc__o = doc._o
  6416.         if elem is None: elem__o = None
  6417.         else: elem__o = elem._o
  6418.         ret = libxml2mod.xmlValidatePopElement(self._o, doc__o, elem__o, qname)
  6419.         return ret
  6420.  
  6421.     def validatePushCData(self, data, len):
  6422.         """check the CData parsed for validation in the current stack """
  6423.         ret = libxml2mod.xmlValidatePushCData(self._o, data, len)
  6424.         return ret
  6425.  
  6426.     def validatePushElement(self, doc, elem, qname):
  6427.         """Push a new element start on the validation stack. """
  6428.         if doc is None: doc__o = None
  6429.         else: doc__o = doc._o
  6430.         if elem is None: elem__o = None
  6431.         else: elem__o = elem._o
  6432.         ret = libxml2mod.xmlValidatePushElement(self._o, doc__o, elem__o, qname)
  6433.         return ret
  6434.  
  6435.     def validateRoot(self, doc):
  6436.         """Try to validate a the root element basically it does the
  6437.           following check as described by the XML-1.0 recommendation:
  6438.           - [ VC: Root Element Type ] it doesn't try to recurse or
  6439.            apply other check to the element """
  6440.         if doc is None: doc__o = None
  6441.         else: doc__o = doc._o
  6442.         ret = libxml2mod.xmlValidateRoot(self._o, doc__o)
  6443.         return ret
  6444.  
  6445. class xmlNs(xmlNode):
  6446.     def __init__(self, _obj=None):
  6447.         if type(_obj).__name__ != 'PyCObject':
  6448.             raise TypeError, 'xmlNs needs a PyCObject argument'
  6449.         self._o = _obj
  6450.         xmlNode.__init__(self, _obj=_obj)
  6451.  
  6452.     def __repr__(self):
  6453.         return "<xmlNs (%s) object at 0x%x>" % (self.name, long(pos_id (self)))
  6454.  
  6455.     #
  6456.     # xmlNs functions from module tree
  6457.     #
  6458.  
  6459.     def copyNamespace(self):
  6460.         """Do a copy of the namespace. """
  6461.         ret = libxml2mod.xmlCopyNamespace(self._o)
  6462.         if ret is None:raise treeError('xmlCopyNamespace() failed')
  6463.         __tmp = xmlNs(_obj=ret)
  6464.         return __tmp
  6465.  
  6466.     def copyNamespaceList(self):
  6467.         """Do a copy of an namespace list. """
  6468.         ret = libxml2mod.xmlCopyNamespaceList(self._o)
  6469.         if ret is None:raise treeError('xmlCopyNamespaceList() failed')
  6470.         __tmp = xmlNs(_obj=ret)
  6471.         return __tmp
  6472.  
  6473.     def freeNs(self):
  6474.         """Free up the structures associated to a namespace """
  6475.         libxml2mod.xmlFreeNs(self._o)
  6476.  
  6477.     def freeNsList(self):
  6478.         """Free up all the structures associated to the chained
  6479.            namespaces. """
  6480.         libxml2mod.xmlFreeNsList(self._o)
  6481.  
  6482.     def newChild(self, parent, name, content):
  6483.         """Creation of a new child element, added at the end of
  6484.           @parent children list. @ns and @content parameters are
  6485.           optional (None). If @ns is None, the newly created element
  6486.           inherits the namespace of @parent. If @content is non None,
  6487.           a child list containing the TEXTs and ENTITY_REFs node will
  6488.           be created. NOTE: @content is supposed to be a piece of XML
  6489.           CDATA, so it allows entity references. XML special chars
  6490.           must be escaped first by using
  6491.           xmlEncodeEntitiesReentrant(), or xmlNewTextChild() should
  6492.            be used. """
  6493.         if parent is None: parent__o = None
  6494.         else: parent__o = parent._o
  6495.         ret = libxml2mod.xmlNewChild(parent__o, self._o, name, content)
  6496.         if ret is None:raise treeError('xmlNewChild() failed')
  6497.         __tmp = xmlNode(_obj=ret)
  6498.         return __tmp
  6499.  
  6500.     def newDocNode(self, doc, name, content):
  6501.         """Creation of a new node element within a document. @ns and
  6502.           @content are optional (None). NOTE: @content is supposed to
  6503.           be a piece of XML CDATA, so it allow entities references,
  6504.           but XML special chars need to be escaped first by using
  6505.           xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you
  6506.            don't need entities support. """
  6507.         if doc is None: doc__o = None
  6508.         else: doc__o = doc._o
  6509.         ret = libxml2mod.xmlNewDocNode(doc__o, self._o, name, content)
  6510.         if ret is None:raise treeError('xmlNewDocNode() failed')
  6511.         __tmp = xmlNode(_obj=ret)
  6512.         return __tmp
  6513.  
  6514.     def newDocNodeEatName(self, doc, name, content):
  6515.         """Creation of a new node element within a document. @ns and
  6516.           @content are optional (None). NOTE: @content is supposed to
  6517.           be a piece of XML CDATA, so it allow entities references,
  6518.           but XML special chars need to be escaped first by using
  6519.           xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you
  6520.            don't need entities support. """
  6521.         if doc is None: doc__o = None
  6522.         else: doc__o = doc._o
  6523.         ret = libxml2mod.xmlNewDocNodeEatName(doc__o, self._o, name, content)
  6524.         if ret is None:raise treeError('xmlNewDocNodeEatName() failed')
  6525.         __tmp = xmlNode(_obj=ret)
  6526.         return __tmp
  6527.  
  6528.     def newDocRawNode(self, doc, name, content):
  6529.         """Creation of a new node element within a document. @ns and
  6530.            @content are optional (None). """
  6531.         if doc is None: doc__o = None
  6532.         else: doc__o = doc._o
  6533.         ret = libxml2mod.xmlNewDocRawNode(doc__o, self._o, name, content)
  6534.         if ret is None:raise treeError('xmlNewDocRawNode() failed')
  6535.         __tmp = xmlNode(_obj=ret)
  6536.         return __tmp
  6537.  
  6538.     def newNodeEatName(self, name):
  6539.         """Creation of a new node element. @ns is optional (None). """
  6540.         ret = libxml2mod.xmlNewNodeEatName(self._o, name)
  6541.         if ret is None:raise treeError('xmlNewNodeEatName() failed')
  6542.         __tmp = xmlNode(_obj=ret)
  6543.         return __tmp
  6544.  
  6545.     def newNsProp(self, node, name, value):
  6546.         """Create a new property tagged with a namespace and carried
  6547.            by a node. """
  6548.         if node is None: node__o = None
  6549.         else: node__o = node._o
  6550.         ret = libxml2mod.xmlNewNsProp(node__o, self._o, name, value)
  6551.         if ret is None:raise treeError('xmlNewNsProp() failed')
  6552.         __tmp = xmlAttr(_obj=ret)
  6553.         return __tmp
  6554.  
  6555.     def newNsPropEatName(self, node, name, value):
  6556.         """Create a new property tagged with a namespace and carried
  6557.            by a node. """
  6558.         if node is None: node__o = None
  6559.         else: node__o = node._o
  6560.         ret = libxml2mod.xmlNewNsPropEatName(node__o, self._o, name, value)
  6561.         if ret is None:raise treeError('xmlNewNsPropEatName() failed')
  6562.         __tmp = xmlAttr(_obj=ret)
  6563.         return __tmp
  6564.  
  6565.     def newTextChild(self, parent, name, content):
  6566.         """Creation of a new child element, added at the end of
  6567.           @parent children list. @ns and @content parameters are
  6568.           optional (None). If @ns is None, the newly created element
  6569.           inherits the namespace of @parent. If @content is non None,
  6570.           a child TEXT node will be created containing the string
  6571.           @content. NOTE: Use xmlNewChild() if @content will contain
  6572.           entities that need to be preserved. Use this function,
  6573.           xmlNewTextChild(), if you need to ensure that reserved XML
  6574.           chars that might appear in @content, such as the ampersand,
  6575.           greater-than or less-than signs, are automatically replaced
  6576.            by their XML escaped entity representations. """
  6577.         if parent is None: parent__o = None
  6578.         else: parent__o = parent._o
  6579.         ret = libxml2mod.xmlNewTextChild(parent__o, self._o, name, content)
  6580.         if ret is None:raise treeError('xmlNewTextChild() failed')
  6581.         __tmp = xmlNode(_obj=ret)
  6582.         return __tmp
  6583.  
  6584.     def setNs(self, node):
  6585.         """Associate a namespace to a node, a posteriori. """
  6586.         if node is None: node__o = None
  6587.         else: node__o = node._o
  6588.         libxml2mod.xmlSetNs(node__o, self._o)
  6589.  
  6590.     def setNsProp(self, node, name, value):
  6591.         """Set (or reset) an attribute carried by a node. The ns
  6592.            structure must be in scope, this is not checked """
  6593.         if node is None: node__o = None
  6594.         else: node__o = node._o
  6595.         ret = libxml2mod.xmlSetNsProp(node__o, self._o, name, value)
  6596.         if ret is None:raise treeError('xmlSetNsProp() failed')
  6597.         __tmp = xmlAttr(_obj=ret)
  6598.         return __tmp
  6599.  
  6600.     def unsetNsProp(self, node, name):
  6601.         """Remove an attribute carried by a node. """
  6602.         if node is None: node__o = None
  6603.         else: node__o = node._o
  6604.         ret = libxml2mod.xmlUnsetNsProp(node__o, self._o, name)
  6605.         return ret
  6606.  
  6607.     #
  6608.     # xmlNs functions from module xpathInternals
  6609.     #
  6610.  
  6611.     def xpathNodeSetFreeNs(self):
  6612.         """Namespace nodes in libxml don't match the XPath semantic.
  6613.           In a node set the namespace nodes are duplicated and the
  6614.           next pointer is set to the parent node in the XPath
  6615.            semantic. Check if such a node needs to be freed """
  6616.         libxml2mod.xmlXPathNodeSetFreeNs(self._o)
  6617.  
  6618. class xmlTextReaderLocator:
  6619.     def __init__(self, _obj=None):
  6620.         if _obj != None:self._o = _obj;return
  6621.         self._o = None
  6622.  
  6623.     #
  6624.     # xmlTextReaderLocator functions from module xmlreader
  6625.     #
  6626.  
  6627.     def BaseURI(self):
  6628.         """Obtain the base URI for the given locator. """
  6629.         ret = libxml2mod.xmlTextReaderLocatorBaseURI(self._o)
  6630.         return ret
  6631.  
  6632.     def LineNumber(self):
  6633.         """Obtain the line number for the given locator. """
  6634.         ret = libxml2mod.xmlTextReaderLocatorLineNumber(self._o)
  6635.         return ret
  6636.  
  6637. class URI:
  6638.     def __init__(self, _obj=None):
  6639.         if _obj != None:self._o = _obj;return
  6640.         self._o = None
  6641.  
  6642.     def __del__(self):
  6643.         if self._o != None:
  6644.             libxml2mod.xmlFreeURI(self._o)
  6645.         self._o = None
  6646.  
  6647.     # accessors for URI
  6648.     def authority(self):
  6649.         """Get the authority part from an URI """
  6650.         ret = libxml2mod.xmlURIGetAuthority(self._o)
  6651.         return ret
  6652.  
  6653.     def fragment(self):
  6654.         """Get the fragment part from an URI """
  6655.         ret = libxml2mod.xmlURIGetFragment(self._o)
  6656.         return ret
  6657.  
  6658.     def opaque(self):
  6659.         """Get the opaque part from an URI """
  6660.         ret = libxml2mod.xmlURIGetOpaque(self._o)
  6661.         return ret
  6662.  
  6663.     def path(self):
  6664.         """Get the path part from an URI """
  6665.         ret = libxml2mod.xmlURIGetPath(self._o)
  6666.         return ret
  6667.  
  6668.     def port(self):
  6669.         """Get the port part from an URI """
  6670.         ret = libxml2mod.xmlURIGetPort(self._o)
  6671.         return ret
  6672.  
  6673.     def query(self):
  6674.         """Get the query part from an URI """
  6675.         ret = libxml2mod.xmlURIGetQuery(self._o)
  6676.         return ret
  6677.  
  6678.     def queryRaw(self):
  6679.         """Get the raw query part from an URI (i.e. the unescaped
  6680.            form). """
  6681.         ret = libxml2mod.xmlURIGetQueryRaw(self._o)
  6682.         return ret
  6683.  
  6684.     def scheme(self):
  6685.         """Get the scheme part from an URI """
  6686.         ret = libxml2mod.xmlURIGetScheme(self._o)
  6687.         return ret
  6688.  
  6689.     def server(self):
  6690.         """Get the server part from an URI """
  6691.         ret = libxml2mod.xmlURIGetServer(self._o)
  6692.         return ret
  6693.  
  6694.     def setAuthority(self, authority):
  6695.         """Set the authority part of an URI. """
  6696.         libxml2mod.xmlURISetAuthority(self._o, authority)
  6697.  
  6698.     def setFragment(self, fragment):
  6699.         """Set the fragment part of an URI. """
  6700.         libxml2mod.xmlURISetFragment(self._o, fragment)
  6701.  
  6702.     def setOpaque(self, opaque):
  6703.         """Set the opaque part of an URI. """
  6704.         libxml2mod.xmlURISetOpaque(self._o, opaque)
  6705.  
  6706.     def setPath(self, path):
  6707.         """Set the path part of an URI. """
  6708.         libxml2mod.xmlURISetPath(self._o, path)
  6709.  
  6710.     def setPort(self, port):
  6711.         """Set the port part of an URI. """
  6712.         libxml2mod.xmlURISetPort(self._o, port)
  6713.  
  6714.     def setQuery(self, query):
  6715.         """Set the query part of an URI. """
  6716.         libxml2mod.xmlURISetQuery(self._o, query)
  6717.  
  6718.     def setQueryRaw(self, query_raw):
  6719.         """Set the raw query part of an URI (i.e. the unescaped form). """
  6720.         libxml2mod.xmlURISetQueryRaw(self._o, query_raw)
  6721.  
  6722.     def setScheme(self, scheme):
  6723.         """Set the scheme part of an URI. """
  6724.         libxml2mod.xmlURISetScheme(self._o, scheme)
  6725.  
  6726.     def setServer(self, server):
  6727.         """Set the server part of an URI. """
  6728.         libxml2mod.xmlURISetServer(self._o, server)
  6729.  
  6730.     def setUser(self, user):
  6731.         """Set the user part of an URI. """
  6732.         libxml2mod.xmlURISetUser(self._o, user)
  6733.  
  6734.     def user(self):
  6735.         """Get the user part from an URI """
  6736.         ret = libxml2mod.xmlURIGetUser(self._o)
  6737.         return ret
  6738.  
  6739.     #
  6740.     # URI functions from module uri
  6741.     #
  6742.  
  6743.     def parseURIReference(self, str):
  6744.         """Parse an URI reference string and fills in the appropriate
  6745.           fields of the @uri structure  URI-reference = [ absoluteURI
  6746.            | relativeURI ] [ "#" fragment ] """
  6747.         ret = libxml2mod.xmlParseURIReference(self._o, str)
  6748.         return ret
  6749.  
  6750.     def printURI(self, stream):
  6751.         """Prints the URI in the stream @stream. """
  6752.         libxml2mod.xmlPrintURI(stream, self._o)
  6753.  
  6754.     def saveUri(self):
  6755.         """Save the URI as an escaped string """
  6756.         ret = libxml2mod.xmlSaveUri(self._o)
  6757.         return ret
  6758.  
  6759. class xmlAttribute(xmlNode):
  6760.     def __init__(self, _obj=None):
  6761.         if type(_obj).__name__ != 'PyCObject':
  6762.             raise TypeError, 'xmlAttribute needs a PyCObject argument'
  6763.         self._o = _obj
  6764.         xmlNode.__init__(self, _obj=_obj)
  6765.  
  6766.     def __repr__(self):
  6767.         return "<xmlAttribute (%s) object at 0x%x>" % (self.name, long(pos_id (self)))
  6768.  
  6769. class catalog:
  6770.     def __init__(self, _obj=None):
  6771.         if _obj != None:self._o = _obj;return
  6772.         self._o = None
  6773.  
  6774.     def __del__(self):
  6775.         if self._o != None:
  6776.             libxml2mod.xmlFreeCatalog(self._o)
  6777.         self._o = None
  6778.  
  6779.     #
  6780.     # catalog functions from module catalog
  6781.     #
  6782.  
  6783.     def add(self, type, orig, replace):
  6784.         """Add an entry in the catalog, it may overwrite existing but
  6785.            different entries. """
  6786.         ret = libxml2mod.xmlACatalogAdd(self._o, type, orig, replace)
  6787.         return ret
  6788.  
  6789.     def catalogIsEmpty(self):
  6790.         """Check is a catalog is empty """
  6791.         ret = libxml2mod.xmlCatalogIsEmpty(self._o)
  6792.         return ret
  6793.  
  6794.     def convertSGMLCatalog(self):
  6795.         """Convert all the SGML catalog entries as XML ones """
  6796.         ret = libxml2mod.xmlConvertSGMLCatalog(self._o)
  6797.         return ret
  6798.  
  6799.     def dump(self, out):
  6800.         """Dump the given catalog to the given file. """
  6801.         libxml2mod.xmlACatalogDump(self._o, out)
  6802.  
  6803.     def remove(self, value):
  6804.         """Remove an entry from the catalog """
  6805.         ret = libxml2mod.xmlACatalogRemove(self._o, value)
  6806.         return ret
  6807.  
  6808.     def resolve(self, pubID, sysID):
  6809.         """Do a complete resolution lookup of an External Identifier """
  6810.         ret = libxml2mod.xmlACatalogResolve(self._o, pubID, sysID)
  6811.         return ret
  6812.  
  6813.     def resolvePublic(self, pubID):
  6814.         """Try to lookup the catalog local reference associated to a
  6815.            public ID in that catalog """
  6816.         ret = libxml2mod.xmlACatalogResolvePublic(self._o, pubID)
  6817.         return ret
  6818.  
  6819.     def resolveSystem(self, sysID):
  6820.         """Try to lookup the catalog resource for a system ID """
  6821.         ret = libxml2mod.xmlACatalogResolveSystem(self._o, sysID)
  6822.         return ret
  6823.  
  6824.     def resolveURI(self, URI):
  6825.         """Do a complete resolution lookup of an URI """
  6826.         ret = libxml2mod.xmlACatalogResolveURI(self._o, URI)
  6827.         return ret
  6828.  
  6829. class xpathContext:
  6830.     def __init__(self, _obj=None):
  6831.         if _obj != None:self._o = _obj;return
  6832.         self._o = None
  6833.  
  6834.     # accessors for xpathContext
  6835.     def contextDoc(self):
  6836.         """Get the doc from an xpathContext """
  6837.         ret = libxml2mod.xmlXPathGetContextDoc(self._o)
  6838.         if ret is None:raise xpathError('xmlXPathGetContextDoc() failed')
  6839.         __tmp = xmlDoc(_obj=ret)
  6840.         return __tmp
  6841.  
  6842.     def contextNode(self):
  6843.         """Get the current node from an xpathContext """
  6844.         ret = libxml2mod.xmlXPathGetContextNode(self._o)
  6845.         if ret is None:raise xpathError('xmlXPathGetContextNode() failed')
  6846.         __tmp = xmlNode(_obj=ret)
  6847.         return __tmp
  6848.  
  6849.     def contextPosition(self):
  6850.         """Get the current node from an xpathContext """
  6851.         ret = libxml2mod.xmlXPathGetContextPosition(self._o)
  6852.         return ret
  6853.  
  6854.     def contextSize(self):
  6855.         """Get the current node from an xpathContext """
  6856.         ret = libxml2mod.xmlXPathGetContextSize(self._o)
  6857.         return ret
  6858.  
  6859.     def function(self):
  6860.         """Get the current function name xpathContext """
  6861.         ret = libxml2mod.xmlXPathGetFunction(self._o)
  6862.         return ret
  6863.  
  6864.     def functionURI(self):
  6865.         """Get the current function name URI xpathContext """
  6866.         ret = libxml2mod.xmlXPathGetFunctionURI(self._o)
  6867.         return ret
  6868.  
  6869.     def setContextDoc(self, doc):
  6870.         """Set the doc of an xpathContext """
  6871.         if doc is None: doc__o = None
  6872.         else: doc__o = doc._o
  6873.         libxml2mod.xmlXPathSetContextDoc(self._o, doc__o)
  6874.  
  6875.     def setContextNode(self, node):
  6876.         """Set the current node of an xpathContext """
  6877.         if node is None: node__o = None
  6878.         else: node__o = node._o
  6879.         libxml2mod.xmlXPathSetContextNode(self._o, node__o)
  6880.  
  6881.     #
  6882.     # xpathContext functions from module python
  6883.     #
  6884.  
  6885.     def registerXPathFunction(self, name, ns_uri, f):
  6886.         """Register a Python written function to the XPath interpreter """
  6887.         ret = libxml2mod.xmlRegisterXPathFunction(self._o, name, ns_uri, f)
  6888.         return ret
  6889.  
  6890.     #
  6891.     # xpathContext functions from module xpath
  6892.     #
  6893.  
  6894.     def xpathContextSetCache(self, active, value, options):
  6895.         """Creates/frees an object cache on the XPath context. If
  6896.           activates XPath objects (xmlXPathObject) will be cached
  6897.           internally to be reused. @options: 0: This will set the
  6898.           XPath object caching: @value: This will set the maximum
  6899.           number of XPath objects to be cached per slot There are 5
  6900.           slots for: node-set, string, number, boolean, and misc
  6901.           objects. Use <0 for the default number (100). Other values
  6902.            for @options have currently no effect. """
  6903.         ret = libxml2mod.xmlXPathContextSetCache(self._o, active, value, options)
  6904.         return ret
  6905.  
  6906.     def xpathEval(self, str):
  6907.         """Evaluate the XPath Location Path in the given context. """
  6908.         ret = libxml2mod.xmlXPathEval(str, self._o)
  6909.         if ret is None:raise xpathError('xmlXPathEval() failed')
  6910.         return xpathObjectRet(ret)
  6911.  
  6912.     def xpathEvalExpression(self, str):
  6913.         """Evaluate the XPath expression in the given context. """
  6914.         ret = libxml2mod.xmlXPathEvalExpression(str, self._o)
  6915.         if ret is None:raise xpathError('xmlXPathEvalExpression() failed')
  6916.         return xpathObjectRet(ret)
  6917.  
  6918.     def xpathFreeContext(self):
  6919.         """Free up an xmlXPathContext """
  6920.         libxml2mod.xmlXPathFreeContext(self._o)
  6921.  
  6922.     #
  6923.     # xpathContext functions from module xpathInternals
  6924.     #
  6925.  
  6926.     def xpathNewParserContext(self, str):
  6927.         """Create a new xmlXPathParserContext """
  6928.         ret = libxml2mod.xmlXPathNewParserContext(str, self._o)
  6929.         if ret is None:raise xpathError('xmlXPathNewParserContext() failed')
  6930.         __tmp = xpathParserContext(_obj=ret)
  6931.         return __tmp
  6932.  
  6933.     def xpathNsLookup(self, prefix):
  6934.         """Search in the namespace declaration array of the context
  6935.            for the given namespace name associated to the given prefix """
  6936.         ret = libxml2mod.xmlXPathNsLookup(self._o, prefix)
  6937.         return ret
  6938.  
  6939.     def xpathRegisterAllFunctions(self):
  6940.         """Registers all default XPath functions in this context """
  6941.         libxml2mod.xmlXPathRegisterAllFunctions(self._o)
  6942.  
  6943.     def xpathRegisterNs(self, prefix, ns_uri):
  6944.         """Register a new namespace. If @ns_uri is None it unregisters
  6945.            the namespace """
  6946.         ret = libxml2mod.xmlXPathRegisterNs(self._o, prefix, ns_uri)
  6947.         return ret
  6948.  
  6949.     def xpathRegisteredFuncsCleanup(self):
  6950.         """Cleanup the XPath context data associated to registered
  6951.            functions """
  6952.         libxml2mod.xmlXPathRegisteredFuncsCleanup(self._o)
  6953.  
  6954.     def xpathRegisteredNsCleanup(self):
  6955.         """Cleanup the XPath context data associated to registered
  6956.            variables """
  6957.         libxml2mod.xmlXPathRegisteredNsCleanup(self._o)
  6958.  
  6959.     def xpathRegisteredVariablesCleanup(self):
  6960.         """Cleanup the XPath context data associated to registered
  6961.            variables """
  6962.         libxml2mod.xmlXPathRegisteredVariablesCleanup(self._o)
  6963.  
  6964.     def xpathVariableLookup(self, name):
  6965.         """Search in the Variable array of the context for the given
  6966.            variable value. """
  6967.         ret = libxml2mod.xmlXPathVariableLookup(self._o, name)
  6968.         if ret is None:raise xpathError('xmlXPathVariableLookup() failed')
  6969.         return xpathObjectRet(ret)
  6970.  
  6971.     def xpathVariableLookupNS(self, name, ns_uri):
  6972.         """Search in the Variable array of the context for the given
  6973.            variable value. """
  6974.         ret = libxml2mod.xmlXPathVariableLookupNS(self._o, name, ns_uri)
  6975.         if ret is None:raise xpathError('xmlXPathVariableLookupNS() failed')
  6976.         return xpathObjectRet(ret)
  6977.  
  6978.     #
  6979.     # xpathContext functions from module xpointer
  6980.     #
  6981.  
  6982.     def xpointerEval(self, str):
  6983.         """Evaluate the XPath Location Path in the given context. """
  6984.         ret = libxml2mod.xmlXPtrEval(str, self._o)
  6985.         if ret is None:raise treeError('xmlXPtrEval() failed')
  6986.         return xpathObjectRet(ret)
  6987.  
  6988. class xmlElement(xmlNode):
  6989.     def __init__(self, _obj=None):
  6990.         if type(_obj).__name__ != 'PyCObject':
  6991.             raise TypeError, 'xmlElement needs a PyCObject argument'
  6992.         self._o = _obj
  6993.         xmlNode.__init__(self, _obj=_obj)
  6994.  
  6995.     def __repr__(self):
  6996.         return "<xmlElement (%s) object at 0x%x>" % (self.name, long(pos_id (self)))
  6997.  
  6998. class xmlTextReader(xmlTextReaderCore):
  6999.     def __init__(self, _obj=None):
  7000.         self.input = None
  7001.         self._o = _obj
  7002.         xmlTextReaderCore.__init__(self, _obj=_obj)
  7003.  
  7004.     def __del__(self):
  7005.         if self._o != None:
  7006.             libxml2mod.xmlFreeTextReader(self._o)
  7007.         self._o = None
  7008.  
  7009.     #
  7010.     # xmlTextReader functions from module xmlreader
  7011.     #
  7012.  
  7013.     def AttributeCount(self):
  7014.         """Provides the number of attributes of the current node """
  7015.         ret = libxml2mod.xmlTextReaderAttributeCount(self._o)
  7016.         return ret
  7017.  
  7018.     def BaseUri(self):
  7019.         """The base URI of the node. """
  7020.         ret = libxml2mod.xmlTextReaderConstBaseUri(self._o)
  7021.         return ret
  7022.  
  7023.     def ByteConsumed(self):
  7024.         """This function provides the current index of the parser used
  7025.           by the reader, relative to the start of the current entity.
  7026.           This function actually just wraps a call to
  7027.           xmlBytesConsumed() for the parser context associated with
  7028.            the reader. See xmlBytesConsumed() for more information. """
  7029.         ret = libxml2mod.xmlTextReaderByteConsumed(self._o)
  7030.         return ret
  7031.  
  7032.     def Close(self):
  7033.         """This method releases any resources allocated by the current
  7034.           instance changes the state to Closed and close any
  7035.            underlying input. """
  7036.         ret = libxml2mod.xmlTextReaderClose(self._o)
  7037.         return ret
  7038.  
  7039.     def CurrentDoc(self):
  7040.         """Hacking interface allowing to get the xmlDocPtr
  7041.           correponding to the current document being accessed by the
  7042.           xmlTextReader. NOTE: as a result of this call, the reader
  7043.           will not destroy the associated XML document and calling
  7044.           xmlFreeDoc() on the result is needed once the reader
  7045.            parsing has finished. """
  7046.         ret = libxml2mod.xmlTextReaderCurrentDoc(self._o)
  7047.         if ret is None:raise treeError('xmlTextReaderCurrentDoc() failed')
  7048.         __tmp = xmlDoc(_obj=ret)
  7049.         return __tmp
  7050.  
  7051.     def CurrentNode(self):
  7052.         """Hacking interface allowing to get the xmlNodePtr
  7053.           correponding to the current node being accessed by the
  7054.           xmlTextReader. This is dangerous because the underlying
  7055.            node may be destroyed on the next Reads. """
  7056.         ret = libxml2mod.xmlTextReaderCurrentNode(self._o)
  7057.         if ret is None:raise treeError('xmlTextReaderCurrentNode() failed')
  7058.         __tmp = xmlNode(_obj=ret)
  7059.         return __tmp
  7060.  
  7061.     def Depth(self):
  7062.         """The depth of the node in the tree. """
  7063.         ret = libxml2mod.xmlTextReaderDepth(self._o)
  7064.         return ret
  7065.  
  7066.     def Encoding(self):
  7067.         """Determine the encoding of the document being read. """
  7068.         ret = libxml2mod.xmlTextReaderConstEncoding(self._o)
  7069.         return ret
  7070.  
  7071.     def Expand(self):
  7072.         """Reads the contents of the current node and the full
  7073.           subtree. It then makes the subtree available until the next
  7074.            xmlTextReaderRead() call """
  7075.         ret = libxml2mod.xmlTextReaderExpand(self._o)
  7076.         if ret is None:raise treeError('xmlTextReaderExpand() failed')
  7077.         __tmp = xmlNode(_obj=ret)
  7078.         return __tmp
  7079.  
  7080.     def GetAttribute(self, name):
  7081.         """Provides the value of the attribute with the specified
  7082.            qualified name. """
  7083.         ret = libxml2mod.xmlTextReaderGetAttribute(self._o, name)
  7084.         return ret
  7085.  
  7086.     def GetAttributeNo(self, no):
  7087.         """Provides the value of the attribute with the specified
  7088.            index relative to the containing element. """
  7089.         ret = libxml2mod.xmlTextReaderGetAttributeNo(self._o, no)
  7090.         return ret
  7091.  
  7092.     def GetAttributeNs(self, localName, namespaceURI):
  7093.         """Provides the value of the specified attribute """
  7094.         ret = libxml2mod.xmlTextReaderGetAttributeNs(self._o, localName, namespaceURI)
  7095.         return ret
  7096.  
  7097.     def GetParserColumnNumber(self):
  7098.         """Provide the column number of the current parsing point. """
  7099.         ret = libxml2mod.xmlTextReaderGetParserColumnNumber(self._o)
  7100.         return ret
  7101.  
  7102.     def GetParserLineNumber(self):
  7103.         """Provide the line number of the current parsing point. """
  7104.         ret = libxml2mod.xmlTextReaderGetParserLineNumber(self._o)
  7105.         return ret
  7106.  
  7107.     def GetParserProp(self, prop):
  7108.         """Read the parser internal property. """
  7109.         ret = libxml2mod.xmlTextReaderGetParserProp(self._o, prop)
  7110.         return ret
  7111.  
  7112.     def GetRemainder(self):
  7113.         """Method to get the remainder of the buffered XML. this
  7114.           method stops the parser, set its state to End Of File and
  7115.           return the input stream with what is left that the parser
  7116.           did not use.  The implementation is not good, the parser
  7117.           certainly procgressed past what's left in reader->input,
  7118.           and there is an allocation problem. Best would be to
  7119.            rewrite it differently. """
  7120.         ret = libxml2mod.xmlTextReaderGetRemainder(self._o)
  7121.         if ret is None:raise treeError('xmlTextReaderGetRemainder() failed')
  7122.         __tmp = inputBuffer(_obj=ret)
  7123.         return __tmp
  7124.  
  7125.     def HasAttributes(self):
  7126.         """Whether the node has attributes. """
  7127.         ret = libxml2mod.xmlTextReaderHasAttributes(self._o)
  7128.         return ret
  7129.  
  7130.     def HasValue(self):
  7131.         """Whether the node can have a text value. """
  7132.         ret = libxml2mod.xmlTextReaderHasValue(self._o)
  7133.         return ret
  7134.  
  7135.     def IsDefault(self):
  7136.         """Whether an Attribute  node was generated from the default
  7137.            value defined in the DTD or schema. """
  7138.         ret = libxml2mod.xmlTextReaderIsDefault(self._o)
  7139.         return ret
  7140.  
  7141.     def IsEmptyElement(self):
  7142.         """Check if the current node is empty """
  7143.         ret = libxml2mod.xmlTextReaderIsEmptyElement(self._o)
  7144.         return ret
  7145.  
  7146.     def IsNamespaceDecl(self):
  7147.         """Determine whether the current node is a namespace
  7148.            declaration rather than a regular attribute. """
  7149.         ret = libxml2mod.xmlTextReaderIsNamespaceDecl(self._o)
  7150.         return ret
  7151.  
  7152.     def IsValid(self):
  7153.         """Retrieve the validity status from the parser context """
  7154.         ret = libxml2mod.xmlTextReaderIsValid(self._o)
  7155.         return ret
  7156.  
  7157.     def LocalName(self):
  7158.         """The local name of the node. """
  7159.         ret = libxml2mod.xmlTextReaderConstLocalName(self._o)
  7160.         return ret
  7161.  
  7162.     def LookupNamespace(self, prefix):
  7163.         """Resolves a namespace prefix in the scope of the current
  7164.            element. """
  7165.         ret = libxml2mod.xmlTextReaderLookupNamespace(self._o, prefix)
  7166.         return ret
  7167.  
  7168.     def MoveToAttribute(self, name):
  7169.         """Moves the position of the current instance to the attribute
  7170.            with the specified qualified name. """
  7171.         ret = libxml2mod.xmlTextReaderMoveToAttribute(self._o, name)
  7172.         return ret
  7173.  
  7174.     def MoveToAttributeNo(self, no):
  7175.         """Moves the position of the current instance to the attribute
  7176.           with the specified index relative to the containing element. """
  7177.         ret = libxml2mod.xmlTextReaderMoveToAttributeNo(self._o, no)
  7178.         return ret
  7179.  
  7180.     def MoveToAttributeNs(self, localName, namespaceURI):
  7181.         """Moves the position of the current instance to the attribute
  7182.            with the specified local name and namespace URI. """
  7183.         ret = libxml2mod.xmlTextReaderMoveToAttributeNs(self._o, localName, namespaceURI)
  7184.         return ret
  7185.  
  7186.     def MoveToElement(self):
  7187.         """Moves the position of the current instance to the node that
  7188.            contains the current Attribute  node. """
  7189.         ret = libxml2mod.xmlTextReaderMoveToElement(self._o)
  7190.         return ret
  7191.  
  7192.     def MoveToFirstAttribute(self):
  7193.         """Moves the position of the current instance to the first
  7194.            attribute associated with the current node. """
  7195.         ret = libxml2mod.xmlTextReaderMoveToFirstAttribute(self._o)
  7196.         return ret
  7197.  
  7198.     def MoveToNextAttribute(self):
  7199.         """Moves the position of the current instance to the next
  7200.            attribute associated with the current node. """
  7201.         ret = libxml2mod.xmlTextReaderMoveToNextAttribute(self._o)
  7202.         return ret
  7203.  
  7204.     def Name(self):
  7205.         """The qualified name of the node, equal to Prefix :LocalName. """
  7206.         ret = libxml2mod.xmlTextReaderConstName(self._o)
  7207.         return ret
  7208.  
  7209.     def NamespaceUri(self):
  7210.         """The URI defining the namespace associated with the node. """
  7211.         ret = libxml2mod.xmlTextReaderConstNamespaceUri(self._o)
  7212.         return ret
  7213.  
  7214.     def NewDoc(self, cur, URL, encoding, options):
  7215.         """Setup an xmltextReader to parse an XML in-memory document.
  7216.           The parsing flags @options are a combination of
  7217.           xmlParserOption. This reuses the existing @reader
  7218.            xmlTextReader. """
  7219.         ret = libxml2mod.xmlReaderNewDoc(self._o, cur, URL, encoding, options)
  7220.         return ret
  7221.  
  7222.     def NewFd(self, fd, URL, encoding, options):
  7223.         """Setup an xmltextReader to parse an XML from a file
  7224.           descriptor. NOTE that the file descriptor will not be
  7225.           closed when the reader is closed or reset. The parsing
  7226.           flags @options are a combination of xmlParserOption. This
  7227.            reuses the existing @reader xmlTextReader. """
  7228.         ret = libxml2mod.xmlReaderNewFd(self._o, fd, URL, encoding, options)
  7229.         return ret
  7230.  
  7231.     def NewFile(self, filename, encoding, options):
  7232.         """parse an XML file from the filesystem or the network. The
  7233.           parsing flags @options are a combination of
  7234.           xmlParserOption. This reuses the existing @reader
  7235.            xmlTextReader. """
  7236.         ret = libxml2mod.xmlReaderNewFile(self._o, filename, encoding, options)
  7237.         return ret
  7238.  
  7239.     def NewMemory(self, buffer, size, URL, encoding, options):
  7240.         """Setup an xmltextReader to parse an XML in-memory document.
  7241.           The parsing flags @options are a combination of
  7242.           xmlParserOption. This reuses the existing @reader
  7243.            xmlTextReader. """
  7244.         ret = libxml2mod.xmlReaderNewMemory(self._o, buffer, size, URL, encoding, options)
  7245.         return ret
  7246.  
  7247.     def NewWalker(self, doc):
  7248.         """Setup an xmltextReader to parse a preparsed XML document.
  7249.            This reuses the existing @reader xmlTextReader. """
  7250.         if doc is None: doc__o = None
  7251.         else: doc__o = doc._o
  7252.         ret = libxml2mod.xmlReaderNewWalker(self._o, doc__o)
  7253.         return ret
  7254.  
  7255.     def Next(self):
  7256.         """Skip to the node following the current one in document
  7257.            order while avoiding the subtree if any. """
  7258.         ret = libxml2mod.xmlTextReaderNext(self._o)
  7259.         return ret
  7260.  
  7261.     def NextSibling(self):
  7262.         """Skip to the node following the current one in document
  7263.           order while avoiding the subtree if any. Currently
  7264.            implemented only for Readers built on a document """
  7265.         ret = libxml2mod.xmlTextReaderNextSibling(self._o)
  7266.         return ret
  7267.  
  7268.     def NodeType(self):
  7269.         """Get the node type of the current node Reference:
  7270.           http://www.gnu.org/software/dotgnu/pnetlib-doc/System/Xml/Xm
  7271.           lNodeType.html """
  7272.         ret = libxml2mod.xmlTextReaderNodeType(self._o)
  7273.         return ret
  7274.  
  7275.     def Normalization(self):
  7276.         """The value indicating whether to normalize white space and
  7277.           attribute values. Since attribute value and end of line
  7278.           normalizations are a MUST in the XML specification only the
  7279.           value true is accepted. The broken bahaviour of accepting
  7280.           out of range character entities like � is of course not
  7281.            supported either. """
  7282.         ret = libxml2mod.xmlTextReaderNormalization(self._o)
  7283.         return ret
  7284.  
  7285.     def Prefix(self):
  7286.         """A shorthand reference to the namespace associated with the
  7287.            node. """
  7288.         ret = libxml2mod.xmlTextReaderConstPrefix(self._o)
  7289.         return ret
  7290.  
  7291.     def Preserve(self):
  7292.         """This tells the XML Reader to preserve the current node. The
  7293.           caller must also use xmlTextReaderCurrentDoc() to keep an
  7294.            handle on the resulting document once parsing has finished """
  7295.         ret = libxml2mod.xmlTextReaderPreserve(self._o)
  7296.         if ret is None:raise treeError('xmlTextReaderPreserve() failed')
  7297.         __tmp = xmlNode(_obj=ret)
  7298.         return __tmp
  7299.  
  7300.     def QuoteChar(self):
  7301.         """The quotation mark character used to enclose the value of
  7302.            an attribute. """
  7303.         ret = libxml2mod.xmlTextReaderQuoteChar(self._o)
  7304.         return ret
  7305.  
  7306.     def Read(self):
  7307.         """Moves the position of the current instance to the next node
  7308.            in the stream, exposing its properties. """
  7309.         ret = libxml2mod.xmlTextReaderRead(self._o)
  7310.         return ret
  7311.  
  7312.     def ReadAttributeValue(self):
  7313.         """Parses an attribute value into one or more Text and
  7314.            EntityReference nodes. """
  7315.         ret = libxml2mod.xmlTextReaderReadAttributeValue(self._o)
  7316.         return ret
  7317.  
  7318.     def ReadInnerXml(self):
  7319.         """Reads the contents of the current node, including child
  7320.            nodes and markup. """
  7321.         ret = libxml2mod.xmlTextReaderReadInnerXml(self._o)
  7322.         return ret
  7323.  
  7324.     def ReadOuterXml(self):
  7325.         """Reads the contents of the current node, including child
  7326.            nodes and markup. """
  7327.         ret = libxml2mod.xmlTextReaderReadOuterXml(self._o)
  7328.         return ret
  7329.  
  7330.     def ReadState(self):
  7331.         """Gets the read state of the reader. """
  7332.         ret = libxml2mod.xmlTextReaderReadState(self._o)
  7333.         return ret
  7334.  
  7335.     def ReadString(self):
  7336.         """Reads the contents of an element or a text node as a string. """
  7337.         ret = libxml2mod.xmlTextReaderReadString(self._o)
  7338.         return ret
  7339.  
  7340.     def RelaxNGSetSchema(self, schema):
  7341.         """Use RelaxNG to validate the document as it is processed.
  7342.           Activation is only possible before the first Read(). if
  7343.           @schema is None, then RelaxNG validation is desactivated. @
  7344.           The @schema should not be freed until the reader is
  7345.            deallocated or its use has been deactivated. """
  7346.         if schema is None: schema__o = None
  7347.         else: schema__o = schema._o
  7348.         ret = libxml2mod.xmlTextReaderRelaxNGSetSchema(self._o, schema__o)
  7349.         return ret
  7350.  
  7351.     def RelaxNGValidate(self, rng):
  7352.         """Use RelaxNG to validate the document as it is processed.
  7353.           Activation is only possible before the first Read(). if
  7354.            @rng is None, then RelaxNG validation is deactivated. """
  7355.         ret = libxml2mod.xmlTextReaderRelaxNGValidate(self._o, rng)
  7356.         return ret
  7357.  
  7358.     def SchemaValidate(self, xsd):
  7359.         """Use W3C XSD schema to validate the document as it is
  7360.           processed. Activation is only possible before the first
  7361.           Read(). If @xsd is None, then XML Schema validation is
  7362.            deactivated. """
  7363.         ret = libxml2mod.xmlTextReaderSchemaValidate(self._o, xsd)
  7364.         return ret
  7365.  
  7366.     def SchemaValidateCtxt(self, ctxt, options):
  7367.         """Use W3C XSD schema context to validate the document as it
  7368.           is processed. Activation is only possible before the first
  7369.           Read(). If @ctxt is None, then XML Schema validation is
  7370.            deactivated. """
  7371.         if ctxt is None: ctxt__o = None
  7372.         else: ctxt__o = ctxt._o
  7373.         ret = libxml2mod.xmlTextReaderSchemaValidateCtxt(self._o, ctxt__o, options)
  7374.         return ret
  7375.  
  7376.     def SetParserProp(self, prop, value):
  7377.         """Change the parser processing behaviour by changing some of
  7378.           its internal properties. Note that some properties can only
  7379.            be changed before any read has been done. """
  7380.         ret = libxml2mod.xmlTextReaderSetParserProp(self._o, prop, value)
  7381.         return ret
  7382.  
  7383.     def SetSchema(self, schema):
  7384.         """Use XSD Schema to validate the document as it is processed.
  7385.           Activation is only possible before the first Read(). if
  7386.           @schema is None, then Schema validation is desactivated. @
  7387.           The @schema should not be freed until the reader is
  7388.            deallocated or its use has been deactivated. """
  7389.         if schema is None: schema__o = None
  7390.         else: schema__o = schema._o
  7391.         ret = libxml2mod.xmlTextReaderSetSchema(self._o, schema__o)
  7392.         return ret
  7393.  
  7394.     def Setup(self, input, URL, encoding, options):
  7395.         """Setup an XML reader with new options """
  7396.         if input is None: input__o = None
  7397.         else: input__o = input._o
  7398.         ret = libxml2mod.xmlTextReaderSetup(self._o, input__o, URL, encoding, options)
  7399.         return ret
  7400.  
  7401.     def Standalone(self):
  7402.         """Determine the standalone status of the document being read. """
  7403.         ret = libxml2mod.xmlTextReaderStandalone(self._o)
  7404.         return ret
  7405.  
  7406.     def String(self, str):
  7407.         """Get an interned string from the reader, allows for example
  7408.            to speedup string name comparisons """
  7409.         ret = libxml2mod.xmlTextReaderConstString(self._o, str)
  7410.         return ret
  7411.  
  7412.     def Value(self):
  7413.         """Provides the text value of the node if present """
  7414.         ret = libxml2mod.xmlTextReaderConstValue(self._o)
  7415.         return ret
  7416.  
  7417.     def XmlLang(self):
  7418.         """The xml:lang scope within which the node resides. """
  7419.         ret = libxml2mod.xmlTextReaderConstXmlLang(self._o)
  7420.         return ret
  7421.  
  7422.     def XmlVersion(self):
  7423.         """Determine the XML version of the document being read. """
  7424.         ret = libxml2mod.xmlTextReaderConstXmlVersion(self._o)
  7425.         return ret
  7426.  
  7427. class xmlEntity(xmlNode):
  7428.     def __init__(self, _obj=None):
  7429.         if type(_obj).__name__ != 'PyCObject':
  7430.             raise TypeError, 'xmlEntity needs a PyCObject argument'
  7431.         self._o = _obj
  7432.         xmlNode.__init__(self, _obj=_obj)
  7433.  
  7434.     def __repr__(self):
  7435.         return "<xmlEntity (%s) object at 0x%x>" % (self.name, long(pos_id (self)))
  7436.  
  7437.     #
  7438.     # xmlEntity functions from module parserInternals
  7439.     #
  7440.  
  7441.     def handleEntity(self, ctxt):
  7442.         """Default handling of defined entities, when should we define
  7443.           a new input stream ? When do we just handle that as a set
  7444.            of chars ?  OBSOLETE: to be removed at some point. """
  7445.         if ctxt is None: ctxt__o = None
  7446.         else: ctxt__o = ctxt._o
  7447.         libxml2mod.xmlHandleEntity(ctxt__o, self._o)
  7448.  
  7449. class Schema:
  7450.     def __init__(self, _obj=None):
  7451.         if _obj != None:self._o = _obj;return
  7452.         self._o = None
  7453.  
  7454.     def __del__(self):
  7455.         if self._o != None:
  7456.             libxml2mod.xmlSchemaFree(self._o)
  7457.         self._o = None
  7458.  
  7459.     #
  7460.     # Schema functions from module xmlreader
  7461.     #
  7462.  
  7463.     def SetSchema(self, reader):
  7464.         """Use XSD Schema to validate the document as it is processed.
  7465.           Activation is only possible before the first Read(). if
  7466.           @schema is None, then Schema validation is desactivated. @
  7467.           The @schema should not be freed until the reader is
  7468.            deallocated or its use has been deactivated. """
  7469.         if reader is None: reader__o = None
  7470.         else: reader__o = reader._o
  7471.         ret = libxml2mod.xmlTextReaderSetSchema(reader__o, self._o)
  7472.         return ret
  7473.  
  7474.     #
  7475.     # Schema functions from module xmlschemas
  7476.     #
  7477.  
  7478.     def schemaDump(self, output):
  7479.         """Dump a Schema structure. """
  7480.         libxml2mod.xmlSchemaDump(output, self._o)
  7481.  
  7482.     def schemaNewValidCtxt(self):
  7483.         ret = libxml2mod.xmlSchemaNewValidCtxt(self._o)
  7484.         if ret is None:raise treeError('xmlSchemaNewValidCtxt() failed')
  7485.         __tmp = SchemaValidCtxt(_obj=ret)
  7486.         __tmp.schema = self
  7487.         return __tmp
  7488.  
  7489. class Error:
  7490.     def __init__(self, _obj=None):
  7491.         if _obj != None:self._o = _obj;return
  7492.         self._o = None
  7493.  
  7494.     # accessors for Error
  7495.     def code(self):
  7496.         """The error code, e.g. an xmlParserError """
  7497.         ret = libxml2mod.xmlErrorGetCode(self._o)
  7498.         return ret
  7499.  
  7500.     def domain(self):
  7501.         """What part of the library raised this error """
  7502.         ret = libxml2mod.xmlErrorGetDomain(self._o)
  7503.         return ret
  7504.  
  7505.     def file(self):
  7506.         """the filename """
  7507.         ret = libxml2mod.xmlErrorGetFile(self._o)
  7508.         return ret
  7509.  
  7510.     def level(self):
  7511.         """how consequent is the error """
  7512.         ret = libxml2mod.xmlErrorGetLevel(self._o)
  7513.         return ret
  7514.  
  7515.     def line(self):
  7516.         """the line number if available """
  7517.         ret = libxml2mod.xmlErrorGetLine(self._o)
  7518.         return ret
  7519.  
  7520.     def message(self):
  7521.         """human-readable informative error message """
  7522.         ret = libxml2mod.xmlErrorGetMessage(self._o)
  7523.         return ret
  7524.  
  7525.     #
  7526.     # Error functions from module xmlerror
  7527.     #
  7528.  
  7529.     def copyError(self, to):
  7530.         """Save the original error to the new place. """
  7531.         if to is None: to__o = None
  7532.         else: to__o = to._o
  7533.         ret = libxml2mod.xmlCopyError(self._o, to__o)
  7534.         return ret
  7535.  
  7536.     def resetError(self):
  7537.         """Cleanup the error. """
  7538.         libxml2mod.xmlResetError(self._o)
  7539.  
  7540. class relaxNgSchema:
  7541.     def __init__(self, _obj=None):
  7542.         if _obj != None:self._o = _obj;return
  7543.         self._o = None
  7544.  
  7545.     def __del__(self):
  7546.         if self._o != None:
  7547.             libxml2mod.xmlRelaxNGFree(self._o)
  7548.         self._o = None
  7549.  
  7550.     #
  7551.     # relaxNgSchema functions from module relaxng
  7552.     #
  7553.  
  7554.     def relaxNGDump(self, output):
  7555.         """Dump a RelaxNG structure back """
  7556.         libxml2mod.xmlRelaxNGDump(output, self._o)
  7557.  
  7558.     def relaxNGDumpTree(self, output):
  7559.         """Dump the transformed RelaxNG tree. """
  7560.         libxml2mod.xmlRelaxNGDumpTree(output, self._o)
  7561.  
  7562.     def relaxNGNewValidCtxt(self):
  7563.         """Create an XML RelaxNGs validation context based on the
  7564.            given schema """
  7565.         ret = libxml2mod.xmlRelaxNGNewValidCtxt(self._o)
  7566.         if ret is None:raise treeError('xmlRelaxNGNewValidCtxt() failed')
  7567.         __tmp = relaxNgValidCtxt(_obj=ret)
  7568.         __tmp.schema = self
  7569.         return __tmp
  7570.  
  7571.     #
  7572.     # relaxNgSchema functions from module xmlreader
  7573.     #
  7574.  
  7575.     def RelaxNGSetSchema(self, reader):
  7576.         """Use RelaxNG to validate the document as it is processed.
  7577.           Activation is only possible before the first Read(). if
  7578.           @schema is None, then RelaxNG validation is desactivated. @
  7579.           The @schema should not be freed until the reader is
  7580.            deallocated or its use has been deactivated. """
  7581.         if reader is None: reader__o = None
  7582.         else: reader__o = reader._o
  7583.         ret = libxml2mod.xmlTextReaderRelaxNGSetSchema(reader__o, self._o)
  7584.         return ret
  7585.  
  7586. class inputBuffer(ioReadWrapper):
  7587.     def __init__(self, _obj=None):
  7588.         self._o = _obj
  7589.         ioReadWrapper.__init__(self, _obj=_obj)
  7590.  
  7591.     def __del__(self):
  7592.         if self._o != None:
  7593.             libxml2mod.xmlFreeParserInputBuffer(self._o)
  7594.         self._o = None
  7595.  
  7596.     #
  7597.     # inputBuffer functions from module xmlIO
  7598.     #
  7599.  
  7600.     def grow(self, len):
  7601.         """Grow up the content of the input buffer, the old data are
  7602.           preserved This routine handle the I18N transcoding to
  7603.           internal UTF-8 This routine is used when operating the
  7604.           parser in normal (pull) mode  TODO: one should be able to
  7605.           remove one extra copy by copying directly onto in->buffer
  7606.            or in->raw """
  7607.         ret = libxml2mod.xmlParserInputBufferGrow(self._o, len)
  7608.         return ret
  7609.  
  7610.     def push(self, len, buf):
  7611.         """Push the content of the arry in the input buffer This
  7612.           routine handle the I18N transcoding to internal UTF-8 This
  7613.           is used when operating the parser in progressive (push)
  7614.            mode. """
  7615.         ret = libxml2mod.xmlParserInputBufferPush(self._o, len, buf)
  7616.         return ret
  7617.  
  7618.     def read(self, len):
  7619.         """Refresh the content of the input buffer, the old data are
  7620.           considered consumed This routine handle the I18N
  7621.            transcoding to internal UTF-8 """
  7622.         ret = libxml2mod.xmlParserInputBufferRead(self._o, len)
  7623.         return ret
  7624.  
  7625.     #
  7626.     # inputBuffer functions from module xmlreader
  7627.     #
  7628.  
  7629.     def Setup(self, reader, URL, encoding, options):
  7630.         """Setup an XML reader with new options """
  7631.         if reader is None: reader__o = None
  7632.         else: reader__o = reader._o
  7633.         ret = libxml2mod.xmlTextReaderSetup(reader__o, self._o, URL, encoding, options)
  7634.         return ret
  7635.  
  7636.     def newTextReader(self, URI):
  7637.         """Create an xmlTextReader structure fed with @input """
  7638.         ret = libxml2mod.xmlNewTextReader(self._o, URI)
  7639.         if ret is None:raise treeError('xmlNewTextReader() failed')
  7640.         __tmp = xmlTextReader(_obj=ret)
  7641.         __tmp.input = self
  7642.         return __tmp
  7643.  
  7644. class SchemaValidCtxt(SchemaValidCtxtCore):
  7645.     def __init__(self, _obj=None):
  7646.         self.schema = None
  7647.         self._o = _obj
  7648.         SchemaValidCtxtCore.__init__(self, _obj=_obj)
  7649.  
  7650.     def __del__(self):
  7651.         if self._o != None:
  7652.             libxml2mod.xmlSchemaFreeValidCtxt(self._o)
  7653.         self._o = None
  7654.  
  7655.     #
  7656.     # SchemaValidCtxt functions from module xmlreader
  7657.     #
  7658.  
  7659.     def SchemaValidateCtxt(self, reader, options):
  7660.         """Use W3C XSD schema context to validate the document as it
  7661.           is processed. Activation is only possible before the first
  7662.           Read(). If @ctxt is None, then XML Schema validation is
  7663.            deactivated. """
  7664.         if reader is None: reader__o = None
  7665.         else: reader__o = reader._o
  7666.         ret = libxml2mod.xmlTextReaderSchemaValidateCtxt(reader__o, self._o, options)
  7667.         return ret
  7668.  
  7669.     #
  7670.     # SchemaValidCtxt functions from module xmlschemas
  7671.     #
  7672.  
  7673.     def schemaIsValid(self):
  7674.         ret = libxml2mod.xmlSchemaIsValid(self._o)
  7675.         return ret
  7676.  
  7677.     def schemaSetValidOptions(self, options):
  7678.         ret = libxml2mod.xmlSchemaSetValidOptions(self._o, options)
  7679.         return ret
  7680.  
  7681.     def schemaValidCtxtGetOptions(self):
  7682.         ret = libxml2mod.xmlSchemaValidCtxtGetOptions(self._o)
  7683.         return ret
  7684.  
  7685.     def schemaValidateDoc(self, instance):
  7686.         if instance is None: instance__o = None
  7687.         else: instance__o = instance._o
  7688.         ret = libxml2mod.xmlSchemaValidateDoc(self._o, instance__o)
  7689.         return ret
  7690.  
  7691.     def schemaValidateFile(self, filename, options):
  7692.         ret = libxml2mod.xmlSchemaValidateFile(self._o, filename, options)
  7693.         return ret
  7694.  
  7695.     def schemaValidateOneElement(self, elem):
  7696.         if elem is None: elem__o = None
  7697.         else: elem__o = elem._o
  7698.         ret = libxml2mod.xmlSchemaValidateOneElement(self._o, elem__o)
  7699.         return ret
  7700.  
  7701. class outputBuffer(ioWriteWrapper):
  7702.     def __init__(self, _obj=None):
  7703.         self._o = _obj
  7704.         ioWriteWrapper.__init__(self, _obj=_obj)
  7705.  
  7706.     #
  7707.     # outputBuffer functions from module HTMLtree
  7708.     #
  7709.  
  7710.     def htmlDocContentDumpFormatOutput(self, cur, encoding, format):
  7711.         """Dump an HTML document. """
  7712.         if cur is None: cur__o = None
  7713.         else: cur__o = cur._o
  7714.         libxml2mod.htmlDocContentDumpFormatOutput(self._o, cur__o, encoding, format)
  7715.  
  7716.     def htmlDocContentDumpOutput(self, cur, encoding):
  7717.         """Dump an HTML document. Formating return/spaces are added. """
  7718.         if cur is None: cur__o = None
  7719.         else: cur__o = cur._o
  7720.         libxml2mod.htmlDocContentDumpOutput(self._o, cur__o, encoding)
  7721.  
  7722.     def htmlNodeDumpFormatOutput(self, doc, cur, encoding, format):
  7723.         """Dump an HTML node, recursive behaviour,children are printed
  7724.            too. """
  7725.         if doc is None: doc__o = None
  7726.         else: doc__o = doc._o
  7727.         if cur is None: cur__o = None
  7728.         else: cur__o = cur._o
  7729.         libxml2mod.htmlNodeDumpFormatOutput(self._o, doc__o, cur__o, encoding, format)
  7730.  
  7731.     def htmlNodeDumpOutput(self, doc, cur, encoding):
  7732.         """Dump an HTML node, recursive behaviour,children are printed
  7733.            too, and formatting returns/spaces are added. """
  7734.         if doc is None: doc__o = None
  7735.         else: doc__o = doc._o
  7736.         if cur is None: cur__o = None
  7737.         else: cur__o = cur._o
  7738.         libxml2mod.htmlNodeDumpOutput(self._o, doc__o, cur__o, encoding)
  7739.  
  7740.     #
  7741.     # outputBuffer functions from module tree
  7742.     #
  7743.  
  7744.     def nodeDumpOutput(self, doc, cur, level, format, encoding):
  7745.         """Dump an XML node, recursive behaviour, children are printed
  7746.           too. Note that @format = 1 provide node indenting only if
  7747.           xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was
  7748.            called """
  7749.         if doc is None: doc__o = None
  7750.         else: doc__o = doc._o
  7751.         if cur is None: cur__o = None
  7752.         else: cur__o = cur._o
  7753.         libxml2mod.xmlNodeDumpOutput(self._o, doc__o, cur__o, level, format, encoding)
  7754.  
  7755.     def saveFileTo(self, cur, encoding):
  7756.         """Dump an XML document to an I/O buffer. Warning ! This call
  7757.           xmlOutputBufferClose() on buf which is not available after
  7758.            this call. """
  7759.         if cur is None: cur__o = None
  7760.         else: cur__o = cur._o
  7761.         ret = libxml2mod.xmlSaveFileTo(self._o, cur__o, encoding)
  7762.         return ret
  7763.  
  7764.     def saveFormatFileTo(self, cur, encoding, format):
  7765.         """Dump an XML document to an I/O buffer. Warning ! This call
  7766.           xmlOutputBufferClose() on buf which is not available after
  7767.            this call. """
  7768.         if cur is None: cur__o = None
  7769.         else: cur__o = cur._o
  7770.         ret = libxml2mod.xmlSaveFormatFileTo(self._o, cur__o, encoding, format)
  7771.         return ret
  7772.  
  7773.     #
  7774.     # outputBuffer functions from module xmlIO
  7775.     #
  7776.  
  7777.     def write(self, len, buf):
  7778.         """Write the content of the array in the output I/O buffer
  7779.           This routine handle the I18N transcoding from internal
  7780.           UTF-8 The buffer is lossless, i.e. will store in case of
  7781.            partial or delayed writes. """
  7782.         ret = libxml2mod.xmlOutputBufferWrite(self._o, len, buf)
  7783.         return ret
  7784.  
  7785.     def writeString(self, str):
  7786.         """Write the content of the string in the output I/O buffer
  7787.           This routine handle the I18N transcoding from internal
  7788.           UTF-8 The buffer is lossless, i.e. will store in case of
  7789.            partial or delayed writes. """
  7790.         ret = libxml2mod.xmlOutputBufferWriteString(self._o, str)
  7791.         return ret
  7792.  
  7793. # xlinkShow
  7794. XLINK_SHOW_NONE = 0
  7795. XLINK_SHOW_NEW = 1
  7796. XLINK_SHOW_EMBED = 2
  7797. XLINK_SHOW_REPLACE = 3
  7798.  
  7799. # xmlRelaxNGParserFlag
  7800. XML_RELAXNGP_NONE = 0
  7801. XML_RELAXNGP_FREE_DOC = 1
  7802. XML_RELAXNGP_CRNG = 2
  7803.  
  7804. # xmlBufferAllocationScheme
  7805. XML_BUFFER_ALLOC_DOUBLEIT = 1
  7806. XML_BUFFER_ALLOC_EXACT = 2
  7807. XML_BUFFER_ALLOC_IMMUTABLE = 3
  7808.  
  7809. # xmlParserSeverities
  7810. XML_PARSER_SEVERITY_VALIDITY_WARNING = 1
  7811. XML_PARSER_SEVERITY_VALIDITY_ERROR = 2
  7812. XML_PARSER_SEVERITY_WARNING = 3
  7813. XML_PARSER_SEVERITY_ERROR = 4
  7814.  
  7815. # xmlAttributeDefault
  7816. XML_ATTRIBUTE_NONE = 1
  7817. XML_ATTRIBUTE_REQUIRED = 2
  7818. XML_ATTRIBUTE_IMPLIED = 3
  7819. XML_ATTRIBUTE_FIXED = 4
  7820.  
  7821. # xmlSchemaValType
  7822. XML_SCHEMAS_UNKNOWN = 0
  7823. XML_SCHEMAS_STRING = 1
  7824. XML_SCHEMAS_NORMSTRING = 2
  7825. XML_SCHEMAS_DECIMAL = 3
  7826. XML_SCHEMAS_TIME = 4
  7827. XML_SCHEMAS_GDAY = 5
  7828. XML_SCHEMAS_GMONTH = 6
  7829. XML_SCHEMAS_GMONTHDAY = 7
  7830. XML_SCHEMAS_GYEAR = 8
  7831. XML_SCHEMAS_GYEARMONTH = 9
  7832. XML_SCHEMAS_DATE = 10
  7833. XML_SCHEMAS_DATETIME = 11
  7834. XML_SCHEMAS_DURATION = 12
  7835. XML_SCHEMAS_FLOAT = 13
  7836. XML_SCHEMAS_DOUBLE = 14
  7837. XML_SCHEMAS_BOOLEAN = 15
  7838. XML_SCHEMAS_TOKEN = 16
  7839. XML_SCHEMAS_LANGUAGE = 17
  7840. XML_SCHEMAS_NMTOKEN = 18
  7841. XML_SCHEMAS_NMTOKENS = 19
  7842. XML_SCHEMAS_NAME = 20
  7843. XML_SCHEMAS_QNAME = 21
  7844. XML_SCHEMAS_NCNAME = 22
  7845. XML_SCHEMAS_ID = 23
  7846. XML_SCHEMAS_IDREF = 24
  7847. XML_SCHEMAS_IDREFS = 25
  7848. XML_SCHEMAS_ENTITY = 26
  7849. XML_SCHEMAS_ENTITIES = 27
  7850. XML_SCHEMAS_NOTATION = 28
  7851. XML_SCHEMAS_ANYURI = 29
  7852. XML_SCHEMAS_INTEGER = 30
  7853. XML_SCHEMAS_NPINTEGER = 31
  7854. XML_SCHEMAS_NINTEGER = 32
  7855. XML_SCHEMAS_NNINTEGER = 33
  7856. XML_SCHEMAS_PINTEGER = 34
  7857. XML_SCHEMAS_INT = 35
  7858. XML_SCHEMAS_UINT = 36
  7859. XML_SCHEMAS_LONG = 37
  7860. XML_SCHEMAS_ULONG = 38
  7861. XML_SCHEMAS_SHORT = 39
  7862. XML_SCHEMAS_USHORT = 40
  7863. XML_SCHEMAS_BYTE = 41
  7864. XML_SCHEMAS_UBYTE = 42
  7865. XML_SCHEMAS_HEXBINARY = 43
  7866. XML_SCHEMAS_BASE64BINARY = 44
  7867. XML_SCHEMAS_ANYTYPE = 45
  7868. XML_SCHEMAS_ANYSIMPLETYPE = 46
  7869.  
  7870. # xmlParserInputState
  7871. XML_PARSER_EOF = -1
  7872. XML_PARSER_START = 0
  7873. XML_PARSER_MISC = 1
  7874. XML_PARSER_PI = 2
  7875. XML_PARSER_DTD = 3
  7876. XML_PARSER_PROLOG = 4
  7877. XML_PARSER_COMMENT = 5
  7878. XML_PARSER_START_TAG = 6
  7879. XML_PARSER_CONTENT = 7
  7880. XML_PARSER_CDATA_SECTION = 8
  7881. XML_PARSER_END_TAG = 9
  7882. XML_PARSER_ENTITY_DECL = 10
  7883. XML_PARSER_ENTITY_VALUE = 11
  7884. XML_PARSER_ATTRIBUTE_VALUE = 12
  7885. XML_PARSER_SYSTEM_LITERAL = 13
  7886. XML_PARSER_EPILOG = 14
  7887. XML_PARSER_IGNORE = 15
  7888. XML_PARSER_PUBLIC_LITERAL = 16
  7889.  
  7890. # xmlEntityType
  7891. XML_INTERNAL_GENERAL_ENTITY = 1
  7892. XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2
  7893. XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3
  7894. XML_INTERNAL_PARAMETER_ENTITY = 4
  7895. XML_EXTERNAL_PARAMETER_ENTITY = 5
  7896. XML_INTERNAL_PREDEFINED_ENTITY = 6
  7897.  
  7898. # xmlSaveOption
  7899. XML_SAVE_FORMAT = 1
  7900. XML_SAVE_NO_DECL = 2
  7901. XML_SAVE_NO_EMPTY = 4
  7902. XML_SAVE_NO_XHTML = 8
  7903.  
  7904. # xmlPatternFlags
  7905. XML_PATTERN_DEFAULT = 0
  7906. XML_PATTERN_XPATH = 1
  7907. XML_PATTERN_XSSEL = 2
  7908. XML_PATTERN_XSFIELD = 4
  7909.  
  7910. # xmlParserErrors
  7911. XML_ERR_OK = 0
  7912. XML_ERR_INTERNAL_ERROR = 1
  7913. XML_ERR_NO_MEMORY = 2
  7914. XML_ERR_DOCUMENT_START = 3
  7915. XML_ERR_DOCUMENT_EMPTY = 4
  7916. XML_ERR_DOCUMENT_END = 5
  7917. XML_ERR_INVALID_HEX_CHARREF = 6
  7918. XML_ERR_INVALID_DEC_CHARREF = 7
  7919. XML_ERR_INVALID_CHARREF = 8
  7920. XML_ERR_INVALID_CHAR = 9
  7921. XML_ERR_CHARREF_AT_EOF = 10
  7922. XML_ERR_CHARREF_IN_PROLOG = 11
  7923. XML_ERR_CHARREF_IN_EPILOG = 12
  7924. XML_ERR_CHARREF_IN_DTD = 13
  7925. XML_ERR_ENTITYREF_AT_EOF = 14
  7926. XML_ERR_ENTITYREF_IN_PROLOG = 15
  7927. XML_ERR_ENTITYREF_IN_EPILOG = 16
  7928. XML_ERR_ENTITYREF_IN_DTD = 17
  7929. XML_ERR_PEREF_AT_EOF = 18
  7930. XML_ERR_PEREF_IN_PROLOG = 19
  7931. XML_ERR_PEREF_IN_EPILOG = 20
  7932. XML_ERR_PEREF_IN_INT_SUBSET = 21
  7933. XML_ERR_ENTITYREF_NO_NAME = 22
  7934. XML_ERR_ENTITYREF_SEMICOL_MISSING = 23
  7935. XML_ERR_PEREF_NO_NAME = 24
  7936. XML_ERR_PEREF_SEMICOL_MISSING = 25
  7937. XML_ERR_UNDECLARED_ENTITY = 26
  7938. XML_WAR_UNDECLARED_ENTITY = 27
  7939. XML_ERR_UNPARSED_ENTITY = 28
  7940. XML_ERR_ENTITY_IS_EXTERNAL = 29
  7941. XML_ERR_ENTITY_IS_PARAMETER = 30
  7942. XML_ERR_UNKNOWN_ENCODING = 31
  7943. XML_ERR_UNSUPPORTED_ENCODING = 32
  7944. XML_ERR_STRING_NOT_STARTED = 33
  7945. XML_ERR_STRING_NOT_CLOSED = 34
  7946. XML_ERR_NS_DECL_ERROR = 35
  7947. XML_ERR_ENTITY_NOT_STARTED = 36
  7948. XML_ERR_ENTITY_NOT_FINISHED = 37
  7949. XML_ERR_LT_IN_ATTRIBUTE = 38
  7950. XML_ERR_ATTRIBUTE_NOT_STARTED = 39
  7951. XML_ERR_ATTRIBUTE_NOT_FINISHED = 40
  7952. XML_ERR_ATTRIBUTE_WITHOUT_VALUE = 41
  7953. XML_ERR_ATTRIBUTE_REDEFINED = 42
  7954. XML_ERR_LITERAL_NOT_STARTED = 43
  7955. XML_ERR_LITERAL_NOT_FINISHED = 44
  7956. XML_ERR_COMMENT_NOT_FINISHED = 45
  7957. XML_ERR_PI_NOT_STARTED = 46
  7958. XML_ERR_PI_NOT_FINISHED = 47
  7959. XML_ERR_NOTATION_NOT_STARTED = 48
  7960. XML_ERR_NOTATION_NOT_FINISHED = 49
  7961. XML_ERR_ATTLIST_NOT_STARTED = 50
  7962. XML_ERR_ATTLIST_NOT_FINISHED = 51
  7963. XML_ERR_MIXED_NOT_STARTED = 52
  7964. XML_ERR_MIXED_NOT_FINISHED = 53
  7965. XML_ERR_ELEMCONTENT_NOT_STARTED = 54
  7966. XML_ERR_ELEMCONTENT_NOT_FINISHED = 55
  7967. XML_ERR_XMLDECL_NOT_STARTED = 56
  7968. XML_ERR_XMLDECL_NOT_FINISHED = 57
  7969. XML_ERR_CONDSEC_NOT_STARTED = 58
  7970. XML_ERR_CONDSEC_NOT_FINISHED = 59
  7971. XML_ERR_EXT_SUBSET_NOT_FINISHED = 60
  7972. XML_ERR_DOCTYPE_NOT_FINISHED = 61
  7973. XML_ERR_MISPLACED_CDATA_END = 62
  7974. XML_ERR_CDATA_NOT_FINISHED = 63
  7975. XML_ERR_RESERVED_XML_NAME = 64
  7976. XML_ERR_SPACE_REQUIRED = 65
  7977. XML_ERR_SEPARATOR_REQUIRED = 66
  7978. XML_ERR_NMTOKEN_REQUIRED = 67
  7979. XML_ERR_NAME_REQUIRED = 68
  7980. XML_ERR_PCDATA_REQUIRED = 69
  7981. XML_ERR_URI_REQUIRED = 70
  7982. XML_ERR_PUBID_REQUIRED = 71
  7983. XML_ERR_LT_REQUIRED = 72
  7984. XML_ERR_GT_REQUIRED = 73
  7985. XML_ERR_LTSLASH_REQUIRED = 74
  7986. XML_ERR_EQUAL_REQUIRED = 75
  7987. XML_ERR_TAG_NAME_MISMATCH = 76
  7988. XML_ERR_TAG_NOT_FINISHED = 77
  7989. XML_ERR_STANDALONE_VALUE = 78
  7990. XML_ERR_ENCODING_NAME = 79
  7991. XML_ERR_HYPHEN_IN_COMMENT = 80
  7992. XML_ERR_INVALID_ENCODING = 81
  7993. XML_ERR_EXT_ENTITY_STANDALONE = 82
  7994. XML_ERR_CONDSEC_INVALID = 83
  7995. XML_ERR_VALUE_REQUIRED = 84
  7996. XML_ERR_NOT_WELL_BALANCED = 85
  7997. XML_ERR_EXTRA_CONTENT = 86
  7998. XML_ERR_ENTITY_CHAR_ERROR = 87
  7999. XML_ERR_ENTITY_PE_INTERNAL = 88
  8000. XML_ERR_ENTITY_LOOP = 89
  8001. XML_ERR_ENTITY_BOUNDARY = 90
  8002. XML_ERR_INVALID_URI = 91
  8003. XML_ERR_URI_FRAGMENT = 92
  8004. XML_WAR_CATALOG_PI = 93
  8005. XML_ERR_NO_DTD = 94
  8006. XML_ERR_CONDSEC_INVALID_KEYWORD = 95
  8007. XML_ERR_VERSION_MISSING = 96
  8008. XML_WAR_UNKNOWN_VERSION = 97
  8009. XML_WAR_LANG_VALUE = 98
  8010. XML_WAR_NS_URI = 99
  8011. XML_WAR_NS_URI_RELATIVE = 100
  8012. XML_ERR_MISSING_ENCODING = 101
  8013. XML_WAR_SPACE_VALUE = 102
  8014. XML_ERR_NOT_STANDALONE = 103
  8015. XML_ERR_ENTITY_PROCESSING = 104
  8016. XML_ERR_NOTATION_PROCESSING = 105
  8017. XML_WAR_NS_COLUMN = 106
  8018. XML_WAR_ENTITY_REDEFINED = 107
  8019. XML_NS_ERR_XML_NAMESPACE = 200
  8020. XML_NS_ERR_UNDEFINED_NAMESPACE = 201
  8021. XML_NS_ERR_QNAME = 202
  8022. XML_NS_ERR_ATTRIBUTE_REDEFINED = 203
  8023. XML_NS_ERR_EMPTY = 204
  8024. XML_DTD_ATTRIBUTE_DEFAULT = 500
  8025. XML_DTD_ATTRIBUTE_REDEFINED = 501
  8026. XML_DTD_ATTRIBUTE_VALUE = 502
  8027. XML_DTD_CONTENT_ERROR = 503
  8028. XML_DTD_CONTENT_MODEL = 504
  8029. XML_DTD_CONTENT_NOT_DETERMINIST = 505
  8030. XML_DTD_DIFFERENT_PREFIX = 506
  8031. XML_DTD_ELEM_DEFAULT_NAMESPACE = 507
  8032. XML_DTD_ELEM_NAMESPACE = 508
  8033. XML_DTD_ELEM_REDEFINED = 509
  8034. XML_DTD_EMPTY_NOTATION = 510
  8035. XML_DTD_ENTITY_TYPE = 511
  8036. XML_DTD_ID_FIXED = 512
  8037. XML_DTD_ID_REDEFINED = 513
  8038. XML_DTD_ID_SUBSET = 514
  8039. XML_DTD_INVALID_CHILD = 515
  8040. XML_DTD_INVALID_DEFAULT = 516
  8041. XML_DTD_LOAD_ERROR = 517
  8042. XML_DTD_MISSING_ATTRIBUTE = 518
  8043. XML_DTD_MIXED_CORRUPT = 519
  8044. XML_DTD_MULTIPLE_ID = 520
  8045. XML_DTD_NO_DOC = 521
  8046. XML_DTD_NO_DTD = 522
  8047. XML_DTD_NO_ELEM_NAME = 523
  8048. XML_DTD_NO_PREFIX = 524
  8049. XML_DTD_NO_ROOT = 525
  8050. XML_DTD_NOTATION_REDEFINED = 526
  8051. XML_DTD_NOTATION_VALUE = 527
  8052. XML_DTD_NOT_EMPTY = 528
  8053. XML_DTD_NOT_PCDATA = 529
  8054. XML_DTD_NOT_STANDALONE = 530
  8055. XML_DTD_ROOT_NAME = 531
  8056. XML_DTD_STANDALONE_WHITE_SPACE = 532
  8057. XML_DTD_UNKNOWN_ATTRIBUTE = 533
  8058. XML_DTD_UNKNOWN_ELEM = 534
  8059. XML_DTD_UNKNOWN_ENTITY = 535
  8060. XML_DTD_UNKNOWN_ID = 536
  8061. XML_DTD_UNKNOWN_NOTATION = 537
  8062. XML_DTD_STANDALONE_DEFAULTED = 538
  8063. XML_DTD_XMLID_VALUE = 539
  8064. XML_DTD_XMLID_TYPE = 540
  8065. XML_HTML_STRUCURE_ERROR = 800
  8066. XML_HTML_UNKNOWN_TAG = 801
  8067. XML_RNGP_ANYNAME_ATTR_ANCESTOR = 1000
  8068. XML_RNGP_ATTR_CONFLICT = 1001
  8069. XML_RNGP_ATTRIBUTE_CHILDREN = 1002
  8070. XML_RNGP_ATTRIBUTE_CONTENT = 1003
  8071. XML_RNGP_ATTRIBUTE_EMPTY = 1004
  8072. XML_RNGP_ATTRIBUTE_NOOP = 1005
  8073. XML_RNGP_CHOICE_CONTENT = 1006
  8074. XML_RNGP_CHOICE_EMPTY = 1007
  8075. XML_RNGP_CREATE_FAILURE = 1008
  8076. XML_RNGP_DATA_CONTENT = 1009
  8077. XML_RNGP_DEF_CHOICE_AND_INTERLEAVE = 1010
  8078. XML_RNGP_DEFINE_CREATE_FAILED = 1011
  8079. XML_RNGP_DEFINE_EMPTY = 1012
  8080. XML_RNGP_DEFINE_MISSING = 1013
  8081. XML_RNGP_DEFINE_NAME_MISSING = 1014
  8082. XML_RNGP_ELEM_CONTENT_EMPTY = 1015
  8083. XML_RNGP_ELEM_CONTENT_ERROR = 1016
  8084. XML_RNGP_ELEMENT_EMPTY = 1017
  8085. XML_RNGP_ELEMENT_CONTENT = 1018
  8086. XML_RNGP_ELEMENT_NAME = 1019
  8087. XML_RNGP_ELEMENT_NO_CONTENT = 1020
  8088. XML_RNGP_ELEM_TEXT_CONFLICT = 1021
  8089. XML_RNGP_EMPTY = 1022
  8090. XML_RNGP_EMPTY_CONSTRUCT = 1023
  8091. XML_RNGP_EMPTY_CONTENT = 1024
  8092. XML_RNGP_EMPTY_NOT_EMPTY = 1025
  8093. XML_RNGP_ERROR_TYPE_LIB = 1026
  8094. XML_RNGP_EXCEPT_EMPTY = 1027
  8095. XML_RNGP_EXCEPT_MISSING = 1028
  8096. XML_RNGP_EXCEPT_MULTIPLE = 1029
  8097. XML_RNGP_EXCEPT_NO_CONTENT = 1030
  8098. XML_RNGP_EXTERNALREF_EMTPY = 1031
  8099. XML_RNGP_EXTERNAL_REF_FAILURE = 1032
  8100. XML_RNGP_EXTERNALREF_RECURSE = 1033
  8101. XML_RNGP_FORBIDDEN_ATTRIBUTE = 1034
  8102. XML_RNGP_FOREIGN_ELEMENT = 1035
  8103. XML_RNGP_GRAMMAR_CONTENT = 1036
  8104. XML_RNGP_GRAMMAR_EMPTY = 1037
  8105. XML_RNGP_GRAMMAR_MISSING = 1038
  8106. XML_RNGP_GRAMMAR_NO_START = 1039
  8107. XML_RNGP_GROUP_ATTR_CONFLICT = 1040
  8108. XML_RNGP_HREF_ERROR = 1041
  8109. XML_RNGP_INCLUDE_EMPTY = 1042
  8110. XML_RNGP_INCLUDE_FAILURE = 1043
  8111. XML_RNGP_INCLUDE_RECURSE = 1044
  8112. XML_RNGP_INTERLEAVE_ADD = 1045
  8113. XML_RNGP_INTERLEAVE_CREATE_FAILED = 1046
  8114. XML_RNGP_INTERLEAVE_EMPTY = 1047
  8115. XML_RNGP_INTERLEAVE_NO_CONTENT = 1048
  8116. XML_RNGP_INVALID_DEFINE_NAME = 1049
  8117. XML_RNGP_INVALID_URI = 1050
  8118. XML_RNGP_INVALID_VALUE = 1051
  8119. XML_RNGP_MISSING_HREF = 1052
  8120. XML_RNGP_NAME_MISSING = 1053
  8121. XML_RNGP_NEED_COMBINE = 1054
  8122. XML_RNGP_NOTALLOWED_NOT_EMPTY = 1055
  8123. XML_RNGP_NSNAME_ATTR_ANCESTOR = 1056
  8124. XML_RNGP_NSNAME_NO_NS = 1057
  8125. XML_RNGP_PARAM_FORBIDDEN = 1058
  8126. XML_RNGP_PARAM_NAME_MISSING = 1059
  8127. XML_RNGP_PARENTREF_CREATE_FAILED = 1060
  8128. XML_RNGP_PARENTREF_NAME_INVALID = 1061
  8129. XML_RNGP_PARENTREF_NO_NAME = 1062
  8130. XML_RNGP_PARENTREF_NO_PARENT = 1063
  8131. XML_RNGP_PARENTREF_NOT_EMPTY = 1064
  8132. XML_RNGP_PARSE_ERROR = 1065
  8133. XML_RNGP_PAT_ANYNAME_EXCEPT_ANYNAME = 1066
  8134. XML_RNGP_PAT_ATTR_ATTR = 1067
  8135. XML_RNGP_PAT_ATTR_ELEM = 1068
  8136. XML_RNGP_PAT_DATA_EXCEPT_ATTR = 1069
  8137. XML_RNGP_PAT_DATA_EXCEPT_ELEM = 1070
  8138. XML_RNGP_PAT_DATA_EXCEPT_EMPTY = 1071
  8139. XML_RNGP_PAT_DATA_EXCEPT_GROUP = 1072
  8140. XML_RNGP_PAT_DATA_EXCEPT_INTERLEAVE = 1073
  8141. XML_RNGP_PAT_DATA_EXCEPT_LIST = 1074
  8142. XML_RNGP_PAT_DATA_EXCEPT_ONEMORE = 1075
  8143. XML_RNGP_PAT_DATA_EXCEPT_REF = 1076
  8144. XML_RNGP_PAT_DATA_EXCEPT_TEXT = 1077
  8145. XML_RNGP_PAT_LIST_ATTR = 1078
  8146. XML_RNGP_PAT_LIST_ELEM = 1079
  8147. XML_RNGP_PAT_LIST_INTERLEAVE = 1080
  8148. XML_RNGP_PAT_LIST_LIST = 1081
  8149. XML_RNGP_PAT_LIST_REF = 1082
  8150. XML_RNGP_PAT_LIST_TEXT = 1083
  8151. XML_RNGP_PAT_NSNAME_EXCEPT_ANYNAME = 1084
  8152. XML_RNGP_PAT_NSNAME_EXCEPT_NSNAME = 1085
  8153. XML_RNGP_PAT_ONEMORE_GROUP_ATTR = 1086
  8154. XML_RNGP_PAT_ONEMORE_INTERLEAVE_ATTR = 1087
  8155. XML_RNGP_PAT_START_ATTR = 1088
  8156. XML_RNGP_PAT_START_DATA = 1089
  8157. XML_RNGP_PAT_START_EMPTY = 1090
  8158. XML_RNGP_PAT_START_GROUP = 1091
  8159. XML_RNGP_PAT_START_INTERLEAVE = 1092
  8160. XML_RNGP_PAT_START_LIST = 1093
  8161. XML_RNGP_PAT_START_ONEMORE = 1094
  8162. XML_RNGP_PAT_START_TEXT = 1095
  8163. XML_RNGP_PAT_START_VALUE = 1096
  8164. XML_RNGP_PREFIX_UNDEFINED = 1097
  8165. XML_RNGP_REF_CREATE_FAILED = 1098
  8166. XML_RNGP_REF_CYCLE = 1099
  8167. XML_RNGP_REF_NAME_INVALID = 1100
  8168. XML_RNGP_REF_NO_DEF = 1101
  8169. XML_RNGP_REF_NO_NAME = 1102
  8170. XML_RNGP_REF_NOT_EMPTY = 1103
  8171. XML_RNGP_START_CHOICE_AND_INTERLEAVE = 1104
  8172. XML_RNGP_START_CONTENT = 1105
  8173. XML_RNGP_START_EMPTY = 1106
  8174. XML_RNGP_START_MISSING = 1107
  8175. XML_RNGP_TEXT_EXPECTED = 1108
  8176. XML_RNGP_TEXT_HAS_CHILD = 1109
  8177. XML_RNGP_TYPE_MISSING = 1110
  8178. XML_RNGP_TYPE_NOT_FOUND = 1111
  8179. XML_RNGP_TYPE_VALUE = 1112
  8180. XML_RNGP_UNKNOWN_ATTRIBUTE = 1113
  8181. XML_RNGP_UNKNOWN_COMBINE = 1114
  8182. XML_RNGP_UNKNOWN_CONSTRUCT = 1115
  8183. XML_RNGP_UNKNOWN_TYPE_LIB = 1116
  8184. XML_RNGP_URI_FRAGMENT = 1117
  8185. XML_RNGP_URI_NOT_ABSOLUTE = 1118
  8186. XML_RNGP_VALUE_EMPTY = 1119
  8187. XML_RNGP_VALUE_NO_CONTENT = 1120
  8188. XML_RNGP_XMLNS_NAME = 1121
  8189. XML_RNGP_XML_NS = 1122
  8190. XML_XPATH_EXPRESSION_OK = 1200
  8191. XML_XPATH_NUMBER_ERROR = 1201
  8192. XML_XPATH_UNFINISHED_LITERAL_ERROR = 1202
  8193. XML_XPATH_START_LITERAL_ERROR = 1203
  8194. XML_XPATH_VARIABLE_REF_ERROR = 1204
  8195. XML_XPATH_UNDEF_VARIABLE_ERROR = 1205
  8196. XML_XPATH_INVALID_PREDICATE_ERROR = 1206
  8197. XML_XPATH_EXPR_ERROR = 1207
  8198. XML_XPATH_UNCLOSED_ERROR = 1208
  8199. XML_XPATH_UNKNOWN_FUNC_ERROR = 1209
  8200. XML_XPATH_INVALID_OPERAND = 1210
  8201. XML_XPATH_INVALID_TYPE = 1211
  8202. XML_XPATH_INVALID_ARITY = 1212
  8203. XML_XPATH_INVALID_CTXT_SIZE = 1213
  8204. XML_XPATH_INVALID_CTXT_POSITION = 1214
  8205. XML_XPATH_MEMORY_ERROR = 1215
  8206. XML_XPTR_SYNTAX_ERROR = 1216
  8207. XML_XPTR_RESOURCE_ERROR = 1217
  8208. XML_XPTR_SUB_RESOURCE_ERROR = 1218
  8209. XML_XPATH_UNDEF_PREFIX_ERROR = 1219
  8210. XML_XPATH_ENCODING_ERROR = 1220
  8211. XML_XPATH_INVALID_CHAR_ERROR = 1221
  8212. XML_TREE_INVALID_HEX = 1300
  8213. XML_TREE_INVALID_DEC = 1301
  8214. XML_TREE_UNTERMINATED_ENTITY = 1302
  8215. XML_TREE_NOT_UTF8 = 1303
  8216. XML_SAVE_NOT_UTF8 = 1400
  8217. XML_SAVE_CHAR_INVALID = 1401
  8218. XML_SAVE_NO_DOCTYPE = 1402
  8219. XML_SAVE_UNKNOWN_ENCODING = 1403
  8220. XML_REGEXP_COMPILE_ERROR = 1450
  8221. XML_IO_UNKNOWN = 1500
  8222. XML_IO_EACCES = 1501
  8223. XML_IO_EAGAIN = 1502
  8224. XML_IO_EBADF = 1503
  8225. XML_IO_EBADMSG = 1504
  8226. XML_IO_EBUSY = 1505
  8227. XML_IO_ECANCELED = 1506
  8228. XML_IO_ECHILD = 1507
  8229. XML_IO_EDEADLK = 1508
  8230. XML_IO_EDOM = 1509
  8231. XML_IO_EEXIST = 1510
  8232. XML_IO_EFAULT = 1511
  8233. XML_IO_EFBIG = 1512
  8234. XML_IO_EINPROGRESS = 1513
  8235. XML_IO_EINTR = 1514
  8236. XML_IO_EINVAL = 1515
  8237. XML_IO_EIO = 1516
  8238. XML_IO_EISDIR = 1517
  8239. XML_IO_EMFILE = 1518
  8240. XML_IO_EMLINK = 1519
  8241. XML_IO_EMSGSIZE = 1520
  8242. XML_IO_ENAMETOOLONG = 1521
  8243. XML_IO_ENFILE = 1522
  8244. XML_IO_ENODEV = 1523
  8245. XML_IO_ENOENT = 1524
  8246. XML_IO_ENOEXEC = 1525
  8247. XML_IO_ENOLCK = 1526
  8248. XML_IO_ENOMEM = 1527
  8249. XML_IO_ENOSPC = 1528
  8250. XML_IO_ENOSYS = 1529
  8251. XML_IO_ENOTDIR = 1530
  8252. XML_IO_ENOTEMPTY = 1531
  8253. XML_IO_ENOTSUP = 1532
  8254. XML_IO_ENOTTY = 1533
  8255. XML_IO_ENXIO = 1534
  8256. XML_IO_EPERM = 1535
  8257. XML_IO_EPIPE = 1536
  8258. XML_IO_ERANGE = 1537
  8259. XML_IO_EROFS = 1538
  8260. XML_IO_ESPIPE = 1539
  8261. XML_IO_ESRCH = 1540
  8262. XML_IO_ETIMEDOUT = 1541
  8263. XML_IO_EXDEV = 1542
  8264. XML_IO_NETWORK_ATTEMPT = 1543
  8265. XML_IO_ENCODER = 1544
  8266. XML_IO_FLUSH = 1545
  8267. XML_IO_WRITE = 1546
  8268. XML_IO_NO_INPUT = 1547
  8269. XML_IO_BUFFER_FULL = 1548
  8270. XML_IO_LOAD_ERROR = 1549
  8271. XML_IO_ENOTSOCK = 1550
  8272. XML_IO_EISCONN = 1551
  8273. XML_IO_ECONNREFUSED = 1552
  8274. XML_IO_ENETUNREACH = 1553
  8275. XML_IO_EADDRINUSE = 1554
  8276. XML_IO_EALREADY = 1555
  8277. XML_IO_EAFNOSUPPORT = 1556
  8278. XML_XINCLUDE_RECURSION = 1600
  8279. XML_XINCLUDE_PARSE_VALUE = 1601
  8280. XML_XINCLUDE_ENTITY_DEF_MISMATCH = 1602
  8281. XML_XINCLUDE_NO_HREF = 1603
  8282. XML_XINCLUDE_NO_FALLBACK = 1604
  8283. XML_XINCLUDE_HREF_URI = 1605
  8284. XML_XINCLUDE_TEXT_FRAGMENT = 1606
  8285. XML_XINCLUDE_TEXT_DOCUMENT = 1607
  8286. XML_XINCLUDE_INVALID_CHAR = 1608
  8287. XML_XINCLUDE_BUILD_FAILED = 1609
  8288. XML_XINCLUDE_UNKNOWN_ENCODING = 1610
  8289. XML_XINCLUDE_MULTIPLE_ROOT = 1611
  8290. XML_XINCLUDE_XPTR_FAILED = 1612
  8291. XML_XINCLUDE_XPTR_RESULT = 1613
  8292. XML_XINCLUDE_INCLUDE_IN_INCLUDE = 1614
  8293. XML_XINCLUDE_FALLBACKS_IN_INCLUDE = 1615
  8294. XML_XINCLUDE_FALLBACK_NOT_IN_INCLUDE = 1616
  8295. XML_XINCLUDE_DEPRECATED_NS = 1617
  8296. XML_XINCLUDE_FRAGMENT_ID = 1618
  8297. XML_CATALOG_MISSING_ATTR = 1650
  8298. XML_CATALOG_ENTRY_BROKEN = 1651
  8299. XML_CATALOG_PREFER_VALUE = 1652
  8300. XML_CATALOG_NOT_CATALOG = 1653
  8301. XML_CATALOG_RECURSION = 1654
  8302. XML_SCHEMAP_PREFIX_UNDEFINED = 1700
  8303. XML_SCHEMAP_ATTRFORMDEFAULT_VALUE = 1701
  8304. XML_SCHEMAP_ATTRGRP_NONAME_NOREF = 1702
  8305. XML_SCHEMAP_ATTR_NONAME_NOREF = 1703
  8306. XML_SCHEMAP_COMPLEXTYPE_NONAME_NOREF = 1704
  8307. XML_SCHEMAP_ELEMFORMDEFAULT_VALUE = 1705
  8308. XML_SCHEMAP_ELEM_NONAME_NOREF = 1706
  8309. XML_SCHEMAP_EXTENSION_NO_BASE = 1707
  8310. XML_SCHEMAP_FACET_NO_VALUE = 1708
  8311. XML_SCHEMAP_FAILED_BUILD_IMPORT = 1709
  8312. XML_SCHEMAP_GROUP_NONAME_NOREF = 1710
  8313. XML_SCHEMAP_IMPORT_NAMESPACE_NOT_URI = 1711
  8314. XML_SCHEMAP_IMPORT_REDEFINE_NSNAME = 1712
  8315. XML_SCHEMAP_IMPORT_SCHEMA_NOT_URI = 1713
  8316. XML_SCHEMAP_INVALID_BOOLEAN = 1714
  8317. XML_SCHEMAP_INVALID_ENUM = 1715
  8318. XML_SCHEMAP_INVALID_FACET = 1716
  8319. XML_SCHEMAP_INVALID_FACET_VALUE = 1717
  8320. XML_SCHEMAP_INVALID_MAXOCCURS = 1718
  8321. XML_SCHEMAP_INVALID_MINOCCURS = 1719
  8322. XML_SCHEMAP_INVALID_REF_AND_SUBTYPE = 1720
  8323. XML_SCHEMAP_INVALID_WHITE_SPACE = 1721
  8324. XML_SCHEMAP_NOATTR_NOREF = 1722
  8325. XML_SCHEMAP_NOTATION_NO_NAME = 1723
  8326. XML_SCHEMAP_NOTYPE_NOREF = 1724
  8327. XML_SCHEMAP_REF_AND_SUBTYPE = 1725
  8328. XML_SCHEMAP_RESTRICTION_NONAME_NOREF = 1726
  8329. XML_SCHEMAP_SIMPLETYPE_NONAME = 1727
  8330. XML_SCHEMAP_TYPE_AND_SUBTYPE = 1728
  8331. XML_SCHEMAP_UNKNOWN_ALL_CHILD = 1729
  8332. XML_SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD = 1730
  8333. XML_SCHEMAP_UNKNOWN_ATTR_CHILD = 1731
  8334. XML_SCHEMAP_UNKNOWN_ATTRGRP_CHILD = 1732
  8335. XML_SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP = 1733
  8336. XML_SCHEMAP_UNKNOWN_BASE_TYPE = 1734
  8337. XML_SCHEMAP_UNKNOWN_CHOICE_CHILD = 1735
  8338. XML_SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD = 1736
  8339. XML_SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD = 1737
  8340. XML_SCHEMAP_UNKNOWN_ELEM_CHILD = 1738
  8341. XML_SCHEMAP_UNKNOWN_EXTENSION_CHILD = 1739
  8342. XML_SCHEMAP_UNKNOWN_FACET_CHILD = 1740
  8343. XML_SCHEMAP_UNKNOWN_FACET_TYPE = 1741
  8344. XML_SCHEMAP_UNKNOWN_GROUP_CHILD = 1742
  8345. XML_SCHEMAP_UNKNOWN_IMPORT_CHILD = 1743
  8346. XML_SCHEMAP_UNKNOWN_LIST_CHILD = 1744
  8347. XML_SCHEMAP_UNKNOWN_NOTATION_CHILD = 1745
  8348. XML_SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD = 1746
  8349. XML_SCHEMAP_UNKNOWN_REF = 1747
  8350. XML_SCHEMAP_UNKNOWN_RESTRICTION_CHILD = 1748
  8351. XML_SCHEMAP_UNKNOWN_SCHEMAS_CHILD = 1749
  8352. XML_SCHEMAP_UNKNOWN_SEQUENCE_CHILD = 1750
  8353. XML_SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD = 1751
  8354. XML_SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD = 1752
  8355. XML_SCHEMAP_UNKNOWN_TYPE = 1753
  8356. XML_SCHEMAP_UNKNOWN_UNION_CHILD = 1754
  8357. XML_SCHEMAP_ELEM_DEFAULT_FIXED = 1755
  8358. XML_SCHEMAP_REGEXP_INVALID = 1756
  8359. XML_SCHEMAP_FAILED_LOAD = 1757
  8360. XML_SCHEMAP_NOTHING_TO_PARSE = 1758
  8361. XML_SCHEMAP_NOROOT = 1759
  8362. XML_SCHEMAP_REDEFINED_GROUP = 1760
  8363. XML_SCHEMAP_REDEFINED_TYPE = 1761
  8364. XML_SCHEMAP_REDEFINED_ELEMENT = 1762
  8365. XML_SCHEMAP_REDEFINED_ATTRGROUP = 1763
  8366. XML_SCHEMAP_REDEFINED_ATTR = 1764
  8367. XML_SCHEMAP_REDEFINED_NOTATION = 1765
  8368. XML_SCHEMAP_FAILED_PARSE = 1766
  8369. XML_SCHEMAP_UNKNOWN_PREFIX = 1767
  8370. XML_SCHEMAP_DEF_AND_PREFIX = 1768
  8371. XML_SCHEMAP_UNKNOWN_INCLUDE_CHILD = 1769
  8372. XML_SCHEMAP_INCLUDE_SCHEMA_NOT_URI = 1770
  8373. XML_SCHEMAP_INCLUDE_SCHEMA_NO_URI = 1771
  8374. XML_SCHEMAP_NOT_SCHEMA = 1772
  8375. XML_SCHEMAP_UNKNOWN_MEMBER_TYPE = 1773
  8376. XML_SCHEMAP_INVALID_ATTR_USE = 1774
  8377. XML_SCHEMAP_RECURSIVE = 1775
  8378. XML_SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE = 1776
  8379. XML_SCHEMAP_INVALID_ATTR_COMBINATION = 1777
  8380. XML_SCHEMAP_INVALID_ATTR_INLINE_COMBINATION = 1778
  8381. XML_SCHEMAP_MISSING_SIMPLETYPE_CHILD = 1779
  8382. XML_SCHEMAP_INVALID_ATTR_NAME = 1780
  8383. XML_SCHEMAP_REF_AND_CONTENT = 1781
  8384. XML_SCHEMAP_CT_PROPS_CORRECT_1 = 1782
  8385. XML_SCHEMAP_CT_PROPS_CORRECT_2 = 1783
  8386. XML_SCHEMAP_CT_PROPS_CORRECT_3 = 1784
  8387. XML_SCHEMAP_CT_PROPS_CORRECT_4 = 1785
  8388. XML_SCHEMAP_CT_PROPS_CORRECT_5 = 1786
  8389. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1 = 1787
  8390. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1 = 1788
  8391. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2 = 1789
  8392. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_2 = 1790
  8393. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_3 = 1791
  8394. XML_SCHEMAP_WILDCARD_INVALID_NS_MEMBER = 1792
  8395. XML_SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE = 1793
  8396. XML_SCHEMAP_UNION_NOT_EXPRESSIBLE = 1794
  8397. XML_SCHEMAP_SRC_IMPORT_3_1 = 1795
  8398. XML_SCHEMAP_SRC_IMPORT_3_2 = 1796
  8399. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_1 = 1797
  8400. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_2 = 1798
  8401. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_3 = 1799
  8402. XML_SCHEMAP_COS_CT_EXTENDS_1_3 = 1800
  8403. XML_SCHEMAV_NOROOT = 1801
  8404. XML_SCHEMAV_UNDECLAREDELEM = 1802
  8405. XML_SCHEMAV_NOTTOPLEVEL = 1803
  8406. XML_SCHEMAV_MISSING = 1804
  8407. XML_SCHEMAV_WRONGELEM = 1805
  8408. XML_SCHEMAV_NOTYPE = 1806
  8409. XML_SCHEMAV_NOROLLBACK = 1807
  8410. XML_SCHEMAV_ISABSTRACT = 1808
  8411. XML_SCHEMAV_NOTEMPTY = 1809
  8412. XML_SCHEMAV_ELEMCONT = 1810
  8413. XML_SCHEMAV_HAVEDEFAULT = 1811
  8414. XML_SCHEMAV_NOTNILLABLE = 1812
  8415. XML_SCHEMAV_EXTRACONTENT = 1813
  8416. XML_SCHEMAV_INVALIDATTR = 1814
  8417. XML_SCHEMAV_INVALIDELEM = 1815
  8418. XML_SCHEMAV_NOTDETERMINIST = 1816
  8419. XML_SCHEMAV_CONSTRUCT = 1817
  8420. XML_SCHEMAV_INTERNAL = 1818
  8421. XML_SCHEMAV_NOTSIMPLE = 1819
  8422. XML_SCHEMAV_ATTRUNKNOWN = 1820
  8423. XML_SCHEMAV_ATTRINVALID = 1821
  8424. XML_SCHEMAV_VALUE = 1822
  8425. XML_SCHEMAV_FACET = 1823
  8426. XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1 = 1824
  8427. XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2 = 1825
  8428. XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3 = 1826
  8429. XML_SCHEMAV_CVC_TYPE_3_1_1 = 1827
  8430. XML_SCHEMAV_CVC_TYPE_3_1_2 = 1828
  8431. XML_SCHEMAV_CVC_FACET_VALID = 1829
  8432. XML_SCHEMAV_CVC_LENGTH_VALID = 1830
  8433. XML_SCHEMAV_CVC_MINLENGTH_VALID = 1831
  8434. XML_SCHEMAV_CVC_MAXLENGTH_VALID = 1832
  8435. XML_SCHEMAV_CVC_MININCLUSIVE_VALID = 1833
  8436. XML_SCHEMAV_CVC_MAXINCLUSIVE_VALID = 1834
  8437. XML_SCHEMAV_CVC_MINEXCLUSIVE_VALID = 1835
  8438. XML_SCHEMAV_CVC_MAXEXCLUSIVE_VALID = 1836
  8439. XML_SCHEMAV_CVC_TOTALDIGITS_VALID = 1837
  8440. XML_SCHEMAV_CVC_FRACTIONDIGITS_VALID = 1838
  8441. XML_SCHEMAV_CVC_PATTERN_VALID = 1839
  8442. XML_SCHEMAV_CVC_ENUMERATION_VALID = 1840
  8443. XML_SCHEMAV_CVC_COMPLEX_TYPE_2_1 = 1841
  8444. XML_SCHEMAV_CVC_COMPLEX_TYPE_2_2 = 1842
  8445. XML_SCHEMAV_CVC_COMPLEX_TYPE_2_3 = 1843
  8446. XML_SCHEMAV_CVC_COMPLEX_TYPE_2_4 = 1844
  8447. XML_SCHEMAV_CVC_ELT_1 = 1845
  8448. XML_SCHEMAV_CVC_ELT_2 = 1846
  8449. XML_SCHEMAV_CVC_ELT_3_1 = 1847
  8450. XML_SCHEMAV_CVC_ELT_3_2_1 = 1848
  8451. XML_SCHEMAV_CVC_ELT_3_2_2 = 1849
  8452. XML_SCHEMAV_CVC_ELT_4_1 = 1850
  8453. XML_SCHEMAV_CVC_ELT_4_2 = 1851
  8454. XML_SCHEMAV_CVC_ELT_4_3 = 1852
  8455. XML_SCHEMAV_CVC_ELT_5_1_1 = 1853
  8456. XML_SCHEMAV_CVC_ELT_5_1_2 = 1854
  8457. XML_SCHEMAV_CVC_ELT_5_2_1 = 1855
  8458. XML_SCHEMAV_CVC_ELT_5_2_2_1 = 1856
  8459. XML_SCHEMAV_CVC_ELT_5_2_2_2_1 = 1857
  8460. XML_SCHEMAV_CVC_ELT_5_2_2_2_2 = 1858
  8461. XML_SCHEMAV_CVC_ELT_6 = 1859
  8462. XML_SCHEMAV_CVC_ELT_7 = 1860
  8463. XML_SCHEMAV_CVC_ATTRIBUTE_1 = 1861
  8464. XML_SCHEMAV_CVC_ATTRIBUTE_2 = 1862
  8465. XML_SCHEMAV_CVC_ATTRIBUTE_3 = 1863
  8466. XML_SCHEMAV_CVC_ATTRIBUTE_4 = 1864
  8467. XML_SCHEMAV_CVC_COMPLEX_TYPE_3_1 = 1865
  8468. XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_1 = 1866
  8469. XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_2 = 1867
  8470. XML_SCHEMAV_CVC_COMPLEX_TYPE_4 = 1868
  8471. XML_SCHEMAV_CVC_COMPLEX_TYPE_5_1 = 1869
  8472. XML_SCHEMAV_CVC_COMPLEX_TYPE_5_2 = 1870
  8473. XML_SCHEMAV_ELEMENT_CONTENT = 1871
  8474. XML_SCHEMAV_DOCUMENT_ELEMENT_MISSING = 1872
  8475. XML_SCHEMAV_CVC_COMPLEX_TYPE_1 = 1873
  8476. XML_SCHEMAV_CVC_AU = 1874
  8477. XML_SCHEMAV_CVC_TYPE_1 = 1875
  8478. XML_SCHEMAV_CVC_TYPE_2 = 1876
  8479. XML_SCHEMAV_CVC_IDC = 1877
  8480. XML_SCHEMAV_CVC_WILDCARD = 1878
  8481. XML_SCHEMAV_MISC = 1879
  8482. XML_XPTR_UNKNOWN_SCHEME = 1900
  8483. XML_XPTR_CHILDSEQ_START = 1901
  8484. XML_XPTR_EVAL_FAILED = 1902
  8485. XML_XPTR_EXTRA_OBJECTS = 1903
  8486. XML_C14N_CREATE_CTXT = 1950
  8487. XML_C14N_REQUIRES_UTF8 = 1951
  8488. XML_C14N_CREATE_STACK = 1952
  8489. XML_C14N_INVALID_NODE = 1953
  8490. XML_C14N_UNKNOW_NODE = 1954
  8491. XML_C14N_RELATIVE_NAMESPACE = 1955
  8492. XML_FTP_PASV_ANSWER = 2000
  8493. XML_FTP_EPSV_ANSWER = 2001
  8494. XML_FTP_ACCNT = 2002
  8495. XML_FTP_URL_SYNTAX = 2003
  8496. XML_HTTP_URL_SYNTAX = 2020
  8497. XML_HTTP_USE_IP = 2021
  8498. XML_HTTP_UNKNOWN_HOST = 2022
  8499. XML_SCHEMAP_SRC_SIMPLE_TYPE_1 = 3000
  8500. XML_SCHEMAP_SRC_SIMPLE_TYPE_2 = 3001
  8501. XML_SCHEMAP_SRC_SIMPLE_TYPE_3 = 3002
  8502. XML_SCHEMAP_SRC_SIMPLE_TYPE_4 = 3003
  8503. XML_SCHEMAP_SRC_RESOLVE = 3004
  8504. XML_SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE = 3005
  8505. XML_SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE = 3006
  8506. XML_SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES = 3007
  8507. XML_SCHEMAP_ST_PROPS_CORRECT_1 = 3008
  8508. XML_SCHEMAP_ST_PROPS_CORRECT_2 = 3009
  8509. XML_SCHEMAP_ST_PROPS_CORRECT_3 = 3010
  8510. XML_SCHEMAP_COS_ST_RESTRICTS_1_1 = 3011
  8511. XML_SCHEMAP_COS_ST_RESTRICTS_1_2 = 3012
  8512. XML_SCHEMAP_COS_ST_RESTRICTS_1_3_1 = 3013
  8513. XML_SCHEMAP_COS_ST_RESTRICTS_1_3_2 = 3014
  8514. XML_SCHEMAP_COS_ST_RESTRICTS_2_1 = 3015
  8515. XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_1 = 3016
  8516. XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_2 = 3017
  8517. XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_1 = 3018
  8518. XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_2 = 3019
  8519. XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_3 = 3020
  8520. XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_4 = 3021
  8521. XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_5 = 3022
  8522. XML_SCHEMAP_COS_ST_RESTRICTS_3_1 = 3023
  8523. XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1 = 3024
  8524. XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1_2 = 3025
  8525. XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_2 = 3026
  8526. XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_1 = 3027
  8527. XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_3 = 3028
  8528. XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_4 = 3029
  8529. XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_5 = 3030
  8530. XML_SCHEMAP_COS_ST_DERIVED_OK_2_1 = 3031
  8531. XML_SCHEMAP_COS_ST_DERIVED_OK_2_2 = 3032
  8532. XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED = 3033
  8533. XML_SCHEMAP_S4S_ELEM_MISSING = 3034
  8534. XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED = 3035
  8535. XML_SCHEMAP_S4S_ATTR_MISSING = 3036
  8536. XML_SCHEMAP_S4S_ATTR_INVALID_VALUE = 3037
  8537. XML_SCHEMAP_SRC_ELEMENT_1 = 3038
  8538. XML_SCHEMAP_SRC_ELEMENT_2_1 = 3039
  8539. XML_SCHEMAP_SRC_ELEMENT_2_2 = 3040
  8540. XML_SCHEMAP_SRC_ELEMENT_3 = 3041
  8541. XML_SCHEMAP_P_PROPS_CORRECT_1 = 3042
  8542. XML_SCHEMAP_P_PROPS_CORRECT_2_1 = 3043
  8543. XML_SCHEMAP_P_PROPS_CORRECT_2_2 = 3044
  8544. XML_SCHEMAP_E_PROPS_CORRECT_2 = 3045
  8545. XML_SCHEMAP_E_PROPS_CORRECT_3 = 3046
  8546. XML_SCHEMAP_E_PROPS_CORRECT_4 = 3047
  8547. XML_SCHEMAP_E_PROPS_CORRECT_5 = 3048
  8548. XML_SCHEMAP_E_PROPS_CORRECT_6 = 3049
  8549. XML_SCHEMAP_SRC_INCLUDE = 3050
  8550. XML_SCHEMAP_SRC_ATTRIBUTE_1 = 3051
  8551. XML_SCHEMAP_SRC_ATTRIBUTE_2 = 3052
  8552. XML_SCHEMAP_SRC_ATTRIBUTE_3_1 = 3053
  8553. XML_SCHEMAP_SRC_ATTRIBUTE_3_2 = 3054
  8554. XML_SCHEMAP_SRC_ATTRIBUTE_4 = 3055
  8555. XML_SCHEMAP_NO_XMLNS = 3056
  8556. XML_SCHEMAP_NO_XSI = 3057
  8557. XML_SCHEMAP_COS_VALID_DEFAULT_1 = 3058
  8558. XML_SCHEMAP_COS_VALID_DEFAULT_2_1 = 3059
  8559. XML_SCHEMAP_COS_VALID_DEFAULT_2_2_1 = 3060
  8560. XML_SCHEMAP_COS_VALID_DEFAULT_2_2_2 = 3061
  8561. XML_SCHEMAP_CVC_SIMPLE_TYPE = 3062
  8562. XML_SCHEMAP_COS_CT_EXTENDS_1_1 = 3063
  8563. XML_SCHEMAP_SRC_IMPORT_1_1 = 3064
  8564. XML_SCHEMAP_SRC_IMPORT_1_2 = 3065
  8565. XML_SCHEMAP_SRC_IMPORT_2 = 3066
  8566. XML_SCHEMAP_SRC_IMPORT_2_1 = 3067
  8567. XML_SCHEMAP_SRC_IMPORT_2_2 = 3068
  8568. XML_SCHEMAP_INTERNAL = 3069
  8569. XML_SCHEMAP_NOT_DETERMINISTIC = 3070
  8570. XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_1 = 3071
  8571. XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_2 = 3072
  8572. XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_3 = 3073
  8573. XML_SCHEMAP_MG_PROPS_CORRECT_1 = 3074
  8574. XML_SCHEMAP_MG_PROPS_CORRECT_2 = 3075
  8575. XML_SCHEMAP_SRC_CT_1 = 3076
  8576. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3 = 3077
  8577. XML_SCHEMAP_AU_PROPS_CORRECT_2 = 3078
  8578. XML_SCHEMAP_A_PROPS_CORRECT_2 = 3079
  8579. XML_SCHEMAP_C_PROPS_CORRECT = 3080
  8580. XML_SCHEMAP_SRC_REDEFINE = 3081
  8581. XML_SCHEMAP_SRC_IMPORT = 3082
  8582. XML_SCHEMAP_WARN_SKIP_SCHEMA = 3083
  8583. XML_SCHEMAP_WARN_UNLOCATED_SCHEMA = 3084
  8584. XML_SCHEMAP_WARN_ATTR_REDECL_PROH = 3085
  8585. XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH = 3086
  8586. XML_SCHEMAP_AG_PROPS_CORRECT = 3087
  8587. XML_SCHEMAP_COS_CT_EXTENDS_1_2 = 3088
  8588. XML_SCHEMAP_AU_PROPS_CORRECT = 3089
  8589. XML_SCHEMAP_A_PROPS_CORRECT_3 = 3090
  8590. XML_SCHEMAP_COS_ALL_LIMITED = 3091
  8591. XML_SCHEMATRONV_ASSERT = 4000
  8592. XML_SCHEMATRONV_REPORT = 4001
  8593. XML_MODULE_OPEN = 4900
  8594. XML_MODULE_CLOSE = 4901
  8595. XML_CHECK_FOUND_ELEMENT = 5000
  8596. XML_CHECK_FOUND_ATTRIBUTE = 5001
  8597. XML_CHECK_FOUND_TEXT = 5002
  8598. XML_CHECK_FOUND_CDATA = 5003
  8599. XML_CHECK_FOUND_ENTITYREF = 5004
  8600. XML_CHECK_FOUND_ENTITY = 5005
  8601. XML_CHECK_FOUND_PI = 5006
  8602. XML_CHECK_FOUND_COMMENT = 5007
  8603. XML_CHECK_FOUND_DOCTYPE = 5008
  8604. XML_CHECK_FOUND_FRAGMENT = 5009
  8605. XML_CHECK_FOUND_NOTATION = 5010
  8606. XML_CHECK_UNKNOWN_NODE = 5011
  8607. XML_CHECK_ENTITY_TYPE = 5012
  8608. XML_CHECK_NO_PARENT = 5013
  8609. XML_CHECK_NO_DOC = 5014
  8610. XML_CHECK_NO_NAME = 5015
  8611. XML_CHECK_NO_ELEM = 5016
  8612. XML_CHECK_WRONG_DOC = 5017
  8613. XML_CHECK_NO_PREV = 5018
  8614. XML_CHECK_WRONG_PREV = 5019
  8615. XML_CHECK_NO_NEXT = 5020
  8616. XML_CHECK_WRONG_NEXT = 5021
  8617. XML_CHECK_NOT_DTD = 5022
  8618. XML_CHECK_NOT_ATTR = 5023
  8619. XML_CHECK_NOT_ATTR_DECL = 5024
  8620. XML_CHECK_NOT_ELEM_DECL = 5025
  8621. XML_CHECK_NOT_ENTITY_DECL = 5026
  8622. XML_CHECK_NOT_NS_DECL = 5027
  8623. XML_CHECK_NO_HREF = 5028
  8624. XML_CHECK_WRONG_PARENT = 5029
  8625. XML_CHECK_NS_SCOPE = 5030
  8626. XML_CHECK_NS_ANCESTOR = 5031
  8627. XML_CHECK_NOT_UTF8 = 5032
  8628. XML_CHECK_NO_DICT = 5033
  8629. XML_CHECK_NOT_NCNAME = 5034
  8630. XML_CHECK_OUTSIDE_DICT = 5035
  8631. XML_CHECK_WRONG_NAME = 5036
  8632. XML_CHECK_NAME_NOT_NULL = 5037
  8633. XML_I18N_NO_NAME = 6000
  8634. XML_I18N_NO_HANDLER = 6001
  8635. XML_I18N_EXCESS_HANDLER = 6002
  8636. XML_I18N_CONV_FAILED = 6003
  8637. XML_I18N_NO_OUTPUT = 6004
  8638. XML_CHECK_ = 6005
  8639. XML_CHECK_X = 6006
  8640.  
  8641. # xmlExpNodeType
  8642. XML_EXP_EMPTY = 0
  8643. XML_EXP_FORBID = 1
  8644. XML_EXP_ATOM = 2
  8645. XML_EXP_SEQ = 3
  8646. XML_EXP_OR = 4
  8647. XML_EXP_COUNT = 5
  8648.  
  8649. # xmlModuleOption
  8650. XML_MODULE_LAZY = 1
  8651. XML_MODULE_LOCAL = 2
  8652.  
  8653. # xmlParserProperties
  8654. XML_PARSER_LOADDTD = 1
  8655. XML_PARSER_DEFAULTATTRS = 2
  8656. XML_PARSER_VALIDATE = 3
  8657. XML_PARSER_SUBST_ENTITIES = 4
  8658.  
  8659. # xmlReaderTypes
  8660. XML_READER_TYPE_NONE = 0
  8661. XML_READER_TYPE_ELEMENT = 1
  8662. XML_READER_TYPE_ATTRIBUTE = 2
  8663. XML_READER_TYPE_TEXT = 3
  8664. XML_READER_TYPE_CDATA = 4
  8665. XML_READER_TYPE_ENTITY_REFERENCE = 5
  8666. XML_READER_TYPE_ENTITY = 6
  8667. XML_READER_TYPE_PROCESSING_INSTRUCTION = 7
  8668. XML_READER_TYPE_COMMENT = 8
  8669. XML_READER_TYPE_DOCUMENT = 9
  8670. XML_READER_TYPE_DOCUMENT_TYPE = 10
  8671. XML_READER_TYPE_DOCUMENT_FRAGMENT = 11
  8672. XML_READER_TYPE_NOTATION = 12
  8673. XML_READER_TYPE_WHITESPACE = 13
  8674. XML_READER_TYPE_SIGNIFICANT_WHITESPACE = 14
  8675. XML_READER_TYPE_END_ELEMENT = 15
  8676. XML_READER_TYPE_END_ENTITY = 16
  8677. XML_READER_TYPE_XML_DECLARATION = 17
  8678.  
  8679. # xmlCatalogPrefer
  8680. XML_CATA_PREFER_NONE = 0
  8681. XML_CATA_PREFER_PUBLIC = 1
  8682. XML_CATA_PREFER_SYSTEM = 2
  8683.  
  8684. # xmlElementType
  8685. XML_ELEMENT_NODE = 1
  8686. XML_ATTRIBUTE_NODE = 2
  8687. XML_TEXT_NODE = 3
  8688. XML_CDATA_SECTION_NODE = 4
  8689. XML_ENTITY_REF_NODE = 5
  8690. XML_ENTITY_NODE = 6
  8691. XML_PI_NODE = 7
  8692. XML_COMMENT_NODE = 8
  8693. XML_DOCUMENT_NODE = 9
  8694. XML_DOCUMENT_TYPE_NODE = 10
  8695. XML_DOCUMENT_FRAG_NODE = 11
  8696. XML_NOTATION_NODE = 12
  8697. XML_HTML_DOCUMENT_NODE = 13
  8698. XML_DTD_NODE = 14
  8699. XML_ELEMENT_DECL = 15
  8700. XML_ATTRIBUTE_DECL = 16
  8701. XML_ENTITY_DECL = 17
  8702. XML_NAMESPACE_DECL = 18
  8703. XML_XINCLUDE_START = 19
  8704. XML_XINCLUDE_END = 20
  8705. XML_DOCB_DOCUMENT_NODE = 21
  8706.  
  8707. # xlinkActuate
  8708. XLINK_ACTUATE_NONE = 0
  8709. XLINK_ACTUATE_AUTO = 1
  8710. XLINK_ACTUATE_ONREQUEST = 2
  8711.  
  8712. # xmlFeature
  8713. XML_WITH_THREAD = 1
  8714. XML_WITH_TREE = 2
  8715. XML_WITH_OUTPUT = 3
  8716. XML_WITH_PUSH = 4
  8717. XML_WITH_READER = 5
  8718. XML_WITH_PATTERN = 6
  8719. XML_WITH_WRITER = 7
  8720. XML_WITH_SAX1 = 8
  8721. XML_WITH_FTP = 9
  8722. XML_WITH_HTTP = 10
  8723. XML_WITH_VALID = 11
  8724. XML_WITH_HTML = 12
  8725. XML_WITH_LEGACY = 13
  8726. XML_WITH_C14N = 14
  8727. XML_WITH_CATALOG = 15
  8728. XML_WITH_XPATH = 16
  8729. XML_WITH_XPTR = 17
  8730. XML_WITH_XINCLUDE = 18
  8731. XML_WITH_ICONV = 19
  8732. XML_WITH_ISO8859X = 20
  8733. XML_WITH_UNICODE = 21
  8734. XML_WITH_REGEXP = 22
  8735. XML_WITH_AUTOMATA = 23
  8736. XML_WITH_EXPR = 24
  8737. XML_WITH_SCHEMAS = 25
  8738. XML_WITH_SCHEMATRON = 26
  8739. XML_WITH_MODULES = 27
  8740. XML_WITH_DEBUG = 28
  8741. XML_WITH_DEBUG_MEM = 29
  8742. XML_WITH_DEBUG_RUN = 30
  8743. XML_WITH_ZLIB = 31
  8744. XML_WITH_NONE = 99999
  8745.  
  8746. # xmlElementContentOccur
  8747. XML_ELEMENT_CONTENT_ONCE = 1
  8748. XML_ELEMENT_CONTENT_OPT = 2
  8749. XML_ELEMENT_CONTENT_MULT = 3
  8750. XML_ELEMENT_CONTENT_PLUS = 4
  8751.  
  8752. # xmlXPathError
  8753. XPATH_EXPRESSION_OK = 0
  8754. XPATH_NUMBER_ERROR = 1
  8755. XPATH_UNFINISHED_LITERAL_ERROR = 2
  8756. XPATH_START_LITERAL_ERROR = 3
  8757. XPATH_VARIABLE_REF_ERROR = 4
  8758. XPATH_UNDEF_VARIABLE_ERROR = 5
  8759. XPATH_INVALID_PREDICATE_ERROR = 6
  8760. XPATH_EXPR_ERROR = 7
  8761. XPATH_UNCLOSED_ERROR = 8
  8762. XPATH_UNKNOWN_FUNC_ERROR = 9
  8763. XPATH_INVALID_OPERAND = 10
  8764. XPATH_INVALID_TYPE = 11
  8765. XPATH_INVALID_ARITY = 12
  8766. XPATH_INVALID_CTXT_SIZE = 13
  8767. XPATH_INVALID_CTXT_POSITION = 14
  8768. XPATH_MEMORY_ERROR = 15
  8769. XPTR_SYNTAX_ERROR = 16
  8770. XPTR_RESOURCE_ERROR = 17
  8771. XPTR_SUB_RESOURCE_ERROR = 18
  8772. XPATH_UNDEF_PREFIX_ERROR = 19
  8773. XPATH_ENCODING_ERROR = 20
  8774. XPATH_INVALID_CHAR_ERROR = 21
  8775. XPATH_INVALID_CTXT = 22
  8776.  
  8777. # xmlElementContentType
  8778. XML_ELEMENT_CONTENT_PCDATA = 1
  8779. XML_ELEMENT_CONTENT_ELEMENT = 2
  8780. XML_ELEMENT_CONTENT_SEQ = 3
  8781. XML_ELEMENT_CONTENT_OR = 4
  8782.  
  8783. # xmlTextReaderMode
  8784. XML_TEXTREADER_MODE_INITIAL = 0
  8785. XML_TEXTREADER_MODE_INTERACTIVE = 1
  8786. XML_TEXTREADER_MODE_ERROR = 2
  8787. XML_TEXTREADER_MODE_EOF = 3
  8788. XML_TEXTREADER_MODE_CLOSED = 4
  8789. XML_TEXTREADER_MODE_READING = 5
  8790.  
  8791. # xmlErrorLevel
  8792. XML_ERR_NONE = 0
  8793. XML_ERR_WARNING = 1
  8794. XML_ERR_ERROR = 2
  8795. XML_ERR_FATAL = 3
  8796.  
  8797. # xmlCharEncoding
  8798. XML_CHAR_ENCODING_ERROR = -1
  8799. XML_CHAR_ENCODING_NONE = 0
  8800. XML_CHAR_ENCODING_UTF8 = 1
  8801. XML_CHAR_ENCODING_UTF16LE = 2
  8802. XML_CHAR_ENCODING_UTF16BE = 3
  8803. XML_CHAR_ENCODING_UCS4LE = 4
  8804. XML_CHAR_ENCODING_UCS4BE = 5
  8805. XML_CHAR_ENCODING_EBCDIC = 6
  8806. XML_CHAR_ENCODING_UCS4_2143 = 7
  8807. XML_CHAR_ENCODING_UCS4_3412 = 8
  8808. XML_CHAR_ENCODING_UCS2 = 9
  8809. XML_CHAR_ENCODING_8859_1 = 10
  8810. XML_CHAR_ENCODING_8859_2 = 11
  8811. XML_CHAR_ENCODING_8859_3 = 12
  8812. XML_CHAR_ENCODING_8859_4 = 13
  8813. XML_CHAR_ENCODING_8859_5 = 14
  8814. XML_CHAR_ENCODING_8859_6 = 15
  8815. XML_CHAR_ENCODING_8859_7 = 16
  8816. XML_CHAR_ENCODING_8859_8 = 17
  8817. XML_CHAR_ENCODING_8859_9 = 18
  8818. XML_CHAR_ENCODING_2022_JP = 19
  8819. XML_CHAR_ENCODING_SHIFT_JIS = 20
  8820. XML_CHAR_ENCODING_EUC_JP = 21
  8821. XML_CHAR_ENCODING_ASCII = 22
  8822.  
  8823. # xmlErrorDomain
  8824. XML_FROM_NONE = 0
  8825. XML_FROM_PARSER = 1
  8826. XML_FROM_TREE = 2
  8827. XML_FROM_NAMESPACE = 3
  8828. XML_FROM_DTD = 4
  8829. XML_FROM_HTML = 5
  8830. XML_FROM_MEMORY = 6
  8831. XML_FROM_OUTPUT = 7
  8832. XML_FROM_IO = 8
  8833. XML_FROM_FTP = 9
  8834. XML_FROM_HTTP = 10
  8835. XML_FROM_XINCLUDE = 11
  8836. XML_FROM_XPATH = 12
  8837. XML_FROM_XPOINTER = 13
  8838. XML_FROM_REGEXP = 14
  8839. XML_FROM_DATATYPE = 15
  8840. XML_FROM_SCHEMASP = 16
  8841. XML_FROM_SCHEMASV = 17
  8842. XML_FROM_RELAXNGP = 18
  8843. XML_FROM_RELAXNGV = 19
  8844. XML_FROM_CATALOG = 20
  8845. XML_FROM_C14N = 21
  8846. XML_FROM_XSLT = 22
  8847. XML_FROM_VALID = 23
  8848. XML_FROM_CHECK = 24
  8849. XML_FROM_WRITER = 25
  8850. XML_FROM_MODULE = 26
  8851. XML_FROM_I18N = 27
  8852. XML_FROM_SCHEMATRONV = 28
  8853.  
  8854. # htmlStatus
  8855. HTML_NA = 0
  8856. HTML_INVALID = 1
  8857. HTML_DEPRECATED = 2
  8858. HTML_VALID = 4
  8859. HTML_REQUIRED = 12
  8860.  
  8861. # xmlSchemaValidOption
  8862. XML_SCHEMA_VAL_VC_I_CREATE = 1
  8863.  
  8864. # xmlSchemaWhitespaceValueType
  8865. XML_SCHEMA_WHITESPACE_UNKNOWN = 0
  8866. XML_SCHEMA_WHITESPACE_PRESERVE = 1
  8867. XML_SCHEMA_WHITESPACE_REPLACE = 2
  8868. XML_SCHEMA_WHITESPACE_COLLAPSE = 3
  8869.  
  8870. # htmlParserOption
  8871. HTML_PARSE_RECOVER = 1
  8872. HTML_PARSE_NOERROR = 32
  8873. HTML_PARSE_NOWARNING = 64
  8874. HTML_PARSE_PEDANTIC = 128
  8875. HTML_PARSE_NOBLANKS = 256
  8876. HTML_PARSE_NONET = 2048
  8877. HTML_PARSE_COMPACT = 65536
  8878.  
  8879. # xmlRelaxNGValidErr
  8880. XML_RELAXNG_OK = 0
  8881. XML_RELAXNG_ERR_MEMORY = 1
  8882. XML_RELAXNG_ERR_TYPE = 2
  8883. XML_RELAXNG_ERR_TYPEVAL = 3
  8884. XML_RELAXNG_ERR_DUPID = 4
  8885. XML_RELAXNG_ERR_TYPECMP = 5
  8886. XML_RELAXNG_ERR_NOSTATE = 6
  8887. XML_RELAXNG_ERR_NODEFINE = 7
  8888. XML_RELAXNG_ERR_LISTEXTRA = 8
  8889. XML_RELAXNG_ERR_LISTEMPTY = 9
  8890. XML_RELAXNG_ERR_INTERNODATA = 10
  8891. XML_RELAXNG_ERR_INTERSEQ = 11
  8892. XML_RELAXNG_ERR_INTEREXTRA = 12
  8893. XML_RELAXNG_ERR_ELEMNAME = 13
  8894. XML_RELAXNG_ERR_ATTRNAME = 14
  8895. XML_RELAXNG_ERR_ELEMNONS = 15
  8896. XML_RELAXNG_ERR_ATTRNONS = 16
  8897. XML_RELAXNG_ERR_ELEMWRONGNS = 17
  8898. XML_RELAXNG_ERR_ATTRWRONGNS = 18
  8899. XML_RELAXNG_ERR_ELEMEXTRANS = 19
  8900. XML_RELAXNG_ERR_ATTREXTRANS = 20
  8901. XML_RELAXNG_ERR_ELEMNOTEMPTY = 21
  8902. XML_RELAXNG_ERR_NOELEM = 22
  8903. XML_RELAXNG_ERR_NOTELEM = 23
  8904. XML_RELAXNG_ERR_ATTRVALID = 24
  8905. XML_RELAXNG_ERR_CONTENTVALID = 25
  8906. XML_RELAXNG_ERR_EXTRACONTENT = 26
  8907. XML_RELAXNG_ERR_INVALIDATTR = 27
  8908. XML_RELAXNG_ERR_DATAELEM = 28
  8909. XML_RELAXNG_ERR_VALELEM = 29
  8910. XML_RELAXNG_ERR_LISTELEM = 30
  8911. XML_RELAXNG_ERR_DATATYPE = 31
  8912. XML_RELAXNG_ERR_VALUE = 32
  8913. XML_RELAXNG_ERR_LIST = 33
  8914. XML_RELAXNG_ERR_NOGRAMMAR = 34
  8915. XML_RELAXNG_ERR_EXTRADATA = 35
  8916. XML_RELAXNG_ERR_LACKDATA = 36
  8917. XML_RELAXNG_ERR_INTERNAL = 37
  8918. XML_RELAXNG_ERR_ELEMWRONG = 38
  8919. XML_RELAXNG_ERR_TEXTWRONG = 39
  8920.  
  8921. # xmlCatalogAllow
  8922. XML_CATA_ALLOW_NONE = 0
  8923. XML_CATA_ALLOW_GLOBAL = 1
  8924. XML_CATA_ALLOW_DOCUMENT = 2
  8925. XML_CATA_ALLOW_ALL = 3
  8926.  
  8927. # xmlAttributeType
  8928. XML_ATTRIBUTE_CDATA = 1
  8929. XML_ATTRIBUTE_ID = 2
  8930. XML_ATTRIBUTE_IDREF = 3
  8931. XML_ATTRIBUTE_IDREFS = 4
  8932. XML_ATTRIBUTE_ENTITY = 5
  8933. XML_ATTRIBUTE_ENTITIES = 6
  8934. XML_ATTRIBUTE_NMTOKEN = 7
  8935. XML_ATTRIBUTE_NMTOKENS = 8
  8936. XML_ATTRIBUTE_ENUMERATION = 9
  8937. XML_ATTRIBUTE_NOTATION = 10
  8938.  
  8939. # xmlSchematronValidOptions
  8940. XML_SCHEMATRON_OUT_QUIET = 1
  8941. XML_SCHEMATRON_OUT_TEXT = 2
  8942. XML_SCHEMATRON_OUT_XML = 4
  8943. XML_SCHEMATRON_OUT_ERROR = 8
  8944. XML_SCHEMATRON_OUT_FILE = 256
  8945. XML_SCHEMATRON_OUT_BUFFER = 512
  8946. XML_SCHEMATRON_OUT_IO = 1024
  8947.  
  8948. # xmlSchemaContentType
  8949. XML_SCHEMA_CONTENT_UNKNOWN = 0
  8950. XML_SCHEMA_CONTENT_EMPTY = 1
  8951. XML_SCHEMA_CONTENT_ELEMENTS = 2
  8952. XML_SCHEMA_CONTENT_MIXED = 3
  8953. XML_SCHEMA_CONTENT_SIMPLE = 4
  8954. XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS = 5
  8955. XML_SCHEMA_CONTENT_BASIC = 6
  8956. XML_SCHEMA_CONTENT_ANY = 7
  8957.  
  8958. # xmlSchemaTypeType
  8959. XML_SCHEMA_TYPE_BASIC = 1
  8960. XML_SCHEMA_TYPE_ANY = 2
  8961. XML_SCHEMA_TYPE_FACET = 3
  8962. XML_SCHEMA_TYPE_SIMPLE = 4
  8963. XML_SCHEMA_TYPE_COMPLEX = 5
  8964. XML_SCHEMA_TYPE_SEQUENCE = 6
  8965. XML_SCHEMA_TYPE_CHOICE = 7
  8966. XML_SCHEMA_TYPE_ALL = 8
  8967. XML_SCHEMA_TYPE_SIMPLE_CONTENT = 9
  8968. XML_SCHEMA_TYPE_COMPLEX_CONTENT = 10
  8969. XML_SCHEMA_TYPE_UR = 11
  8970. XML_SCHEMA_TYPE_RESTRICTION = 12
  8971. XML_SCHEMA_TYPE_EXTENSION = 13
  8972. XML_SCHEMA_TYPE_ELEMENT = 14
  8973. XML_SCHEMA_TYPE_ATTRIBUTE = 15
  8974. XML_SCHEMA_TYPE_ATTRIBUTEGROUP = 16
  8975. XML_SCHEMA_TYPE_GROUP = 17
  8976. XML_SCHEMA_TYPE_NOTATION = 18
  8977. XML_SCHEMA_TYPE_LIST = 19
  8978. XML_SCHEMA_TYPE_UNION = 20
  8979. XML_SCHEMA_TYPE_ANY_ATTRIBUTE = 21
  8980. XML_SCHEMA_TYPE_IDC_UNIQUE = 22
  8981. XML_SCHEMA_TYPE_IDC_KEY = 23
  8982. XML_SCHEMA_TYPE_IDC_KEYREF = 24
  8983. XML_SCHEMA_TYPE_PARTICLE = 25
  8984. XML_SCHEMA_TYPE_ATTRIBUTE_USE = 26
  8985. XML_SCHEMA_FACET_MININCLUSIVE = 1000
  8986. XML_SCHEMA_FACET_MINEXCLUSIVE = 1001
  8987. XML_SCHEMA_FACET_MAXINCLUSIVE = 1002
  8988. XML_SCHEMA_FACET_MAXEXCLUSIVE = 1003
  8989. XML_SCHEMA_FACET_TOTALDIGITS = 1004
  8990. XML_SCHEMA_FACET_FRACTIONDIGITS = 1005
  8991. XML_SCHEMA_FACET_PATTERN = 1006
  8992. XML_SCHEMA_FACET_ENUMERATION = 1007
  8993. XML_SCHEMA_FACET_WHITESPACE = 1008
  8994. XML_SCHEMA_FACET_LENGTH = 1009
  8995. XML_SCHEMA_FACET_MAXLENGTH = 1010
  8996. XML_SCHEMA_FACET_MINLENGTH = 1011
  8997. XML_SCHEMA_EXTRA_QNAMEREF = 2000
  8998. XML_SCHEMA_EXTRA_ATTR_USE_PROHIB = 2001
  8999.  
  9000. # xmlParserMode
  9001. XML_PARSE_UNKNOWN = 0
  9002. XML_PARSE_DOM = 1
  9003. XML_PARSE_SAX = 2
  9004. XML_PARSE_PUSH_DOM = 3
  9005. XML_PARSE_PUSH_SAX = 4
  9006. XML_PARSE_READER = 5
  9007.  
  9008. # xmlParserOption
  9009. XML_PARSE_RECOVER = 1
  9010. XML_PARSE_NOENT = 2
  9011. XML_PARSE_DTDLOAD = 4
  9012. XML_PARSE_DTDATTR = 8
  9013. XML_PARSE_DTDVALID = 16
  9014. XML_PARSE_NOERROR = 32
  9015. XML_PARSE_NOWARNING = 64
  9016. XML_PARSE_PEDANTIC = 128
  9017. XML_PARSE_NOBLANKS = 256
  9018. XML_PARSE_SAX1 = 512
  9019. XML_PARSE_XINCLUDE = 1024
  9020. XML_PARSE_NONET = 2048
  9021. XML_PARSE_NODICT = 4096
  9022. XML_PARSE_NSCLEAN = 8192
  9023. XML_PARSE_NOCDATA = 16384
  9024. XML_PARSE_NOXINCNODE = 32768
  9025. XML_PARSE_COMPACT = 65536
  9026.  
  9027. # xmlElementTypeVal
  9028. XML_ELEMENT_TYPE_UNDEFINED = 0
  9029. XML_ELEMENT_TYPE_EMPTY = 1
  9030. XML_ELEMENT_TYPE_ANY = 2
  9031. XML_ELEMENT_TYPE_MIXED = 3
  9032. XML_ELEMENT_TYPE_ELEMENT = 4
  9033.  
  9034. # xlinkType
  9035. XLINK_TYPE_NONE = 0
  9036. XLINK_TYPE_SIMPLE = 1
  9037. XLINK_TYPE_EXTENDED = 2
  9038. XLINK_TYPE_EXTENDED_SET = 3
  9039.  
  9040. # xmlXPathObjectType
  9041. XPATH_UNDEFINED = 0
  9042. XPATH_NODESET = 1
  9043. XPATH_BOOLEAN = 2
  9044. XPATH_NUMBER = 3
  9045. XPATH_STRING = 4
  9046. XPATH_POINT = 5
  9047. XPATH_RANGE = 6
  9048. XPATH_LOCATIONSET = 7
  9049. XPATH_USERS = 8
  9050. XPATH_XSLT_TREE = 9
  9051.  
  9052. # xmlSchemaValidError
  9053. XML_SCHEMAS_ERR_OK = 0
  9054. XML_SCHEMAS_ERR_NOROOT = 1
  9055. XML_SCHEMAS_ERR_UNDECLAREDELEM = 2
  9056. XML_SCHEMAS_ERR_NOTTOPLEVEL = 3
  9057. XML_SCHEMAS_ERR_MISSING = 4
  9058. XML_SCHEMAS_ERR_WRONGELEM = 5
  9059. XML_SCHEMAS_ERR_NOTYPE = 6
  9060. XML_SCHEMAS_ERR_NOROLLBACK = 7
  9061. XML_SCHEMAS_ERR_ISABSTRACT = 8
  9062. XML_SCHEMAS_ERR_NOTEMPTY = 9
  9063. XML_SCHEMAS_ERR_ELEMCONT = 10
  9064. XML_SCHEMAS_ERR_HAVEDEFAULT = 11
  9065. XML_SCHEMAS_ERR_NOTNILLABLE = 12
  9066. XML_SCHEMAS_ERR_EXTRACONTENT = 13
  9067. XML_SCHEMAS_ERR_INVALIDATTR = 14
  9068. XML_SCHEMAS_ERR_INVALIDELEM = 15
  9069. XML_SCHEMAS_ERR_NOTDETERMINIST = 16
  9070. XML_SCHEMAS_ERR_CONSTRUCT = 17
  9071. XML_SCHEMAS_ERR_INTERNAL = 18
  9072. XML_SCHEMAS_ERR_NOTSIMPLE = 19
  9073. XML_SCHEMAS_ERR_ATTRUNKNOWN = 20
  9074. XML_SCHEMAS_ERR_ATTRINVALID = 21
  9075. XML_SCHEMAS_ERR_VALUE = 22
  9076. XML_SCHEMAS_ERR_FACET = 23
  9077. XML_SCHEMAS_ERR_ = 24
  9078. XML_SCHEMAS_ERR_XXX = 25
  9079.  
  9080.